Home>Article>Web Front-end> What does onclick mean in html5
Onclick in html5 means "click". The onclick attribute is a type of mouse event, which is triggered when the mouse is clicked. It is used to specify the script to be executed when the event is triggered. The syntax is "
".
The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.
#What does onclick mean in html5
onclick is an attribute of the HTML tag object.
The onclick attribute is a type of mouse event, which is triggered when the mouse is clicked.
The onclick attribute cannot be applied to the following elements:
, , ,
The syntax is as follows:
where script indicates the script that is specified to be executed when the onclick event is triggered.
The example is as follows:
123 字段1:
字段2:
在按钮点击时触发函数。函数将字段1的文字信息复制到字段2。
Output result:
Recommended tutorial: "html video tutorial"
The above is the detailed content of What does onclick mean in html5. For more information, please follow other related articles on the PHP Chinese website!