"."/> ".">

Home>Article>Web Front-end> What does onclick mean in html5

What does onclick mean in html5

WBOY
WBOY Original
2021-12-22 11:01:26 11585browse

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 "".

What does onclick mean in html5

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:

What does onclick mean in html5

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn