How did the onclick property of the button object come from?

button.html
<!DOCTYPE html>
<html>
    <head>
        <title>DOM</title>
    </head>
    <body>
        <button id="button">this is a button</button>
    </body>
</html>
(console)button:
button.onclick = function(){
    alert("Hello World");
}
:

button?
  HTML,<button>button,
  button

buttononclick?
  (https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLButtonElement)
  HTMLButtonElementHTMLElement
  ElementNodeonclick
Jul.30,2021

The < button > tag in

HTML is implemented from DOM's HTMLButtonElement interface class , and
HTMLButtonElement inherits a series of classes from this EventTarget base class.

clipboard.png

EventTarget ""

clipboard.png


Global attribute
Global attributes



MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c2a5-2c2fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c2a5-2c2fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?