NEW

6/recent/ticker-posts

Header Ads Widget

HTML Button Click

 

HTML <Button onClick=" ">

The Html <button onclick=" "> is an event attribute, which executes a script when the button is clicked. This attribute is supported by all browsers. It is also used to call a function when the button is clicked.

Syntax:

  1. <button onclick=" single value script">  

Examples:

Example 1: Following example describes how to use the button tag:

  1. <!DOCTYPE HTML>   
  2. <html>   
  3. <head>    
  4. <title>   
  5. example of onclick button  
  6. </title>   
  7. <script>   
  8. function welcome() {   
  9. window.open("https://www.slogantech.blogspot.com/");  
  10. }   
  11. </script>   
  12. </head>   
  13. <body style = "text-align:center">   
  14. <button onclick="welcome()"> Welcome to our website </button>           
  15. </body>   
  16. </html>         

Output:

HTML Button onClick

Post a Comment

0 Comments

Recents Post

Exploring Paidwork - Your Gateway to Earning Online