Jump to content

What Is Onclick In HTML?


ruhikhan

Recommended Posts

The onclick attribute is an event attribute supported by all browsers. It appears when a user clicks on a button element. If you want to make a button onclick, you need to add the onclick event attribute to the <button> element. The button onclick runs a script when a button is clicked.

Link to comment
Share on other sites

When the user clicks on the element, an onclick JavaScript event will occur. When you click on an HTML object with an onclick attribute, it will run the specified line of code. JavaScript onclick function can be triggered by object.onclick or object.addEventListener
 

Link to comment
Share on other sites

The onclick attribute is an event attribute supported by all browsers. It appears when a user clicks on a button element. If you want to make a button onclick, you need to add the onclick event attribute to the <button> element. The button onclick runs a script when a button is clicked.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...