HOW TO CREATE ALERT BUTTON IN HTML WEB PAGE ?

 

In this post you can learn to create an alert button in html page in very easy way. The steps are given below to create an alert button

  1. First we have to create an html page. For that use any html editor or notepad.
  2. Create an new page and save it as index.html
  3. Then create an html tag and next create ah head tag.
  4. Inside the head tag place the title tag. Title tag is used to show the name of the web page in address box.
  5. At next we have to create an body tag.
  6. Inside the body tag we have to create a button.
  7. For creating button use the button tag (<button> </button>).
  8. For placing the name of the button write the name inside the button tag. eg: <button> CONVERT </button>.
  9. Then we have to create an alert. For creating an alert use java script.
  10. we can use inner java script in html (<script> </script>). Inside the script tag you can write ah peace of code to display alert.
  11. The example code is given below and demo button also given below .

HTML CODE FOR CREATE ALERT

<html>
  <head>
    <title>ALERT</title>
  </head>
 <body>
     <p>This program is for create an alert</p>
     <br>
     <button type="submit" onclick="alerts()">CLICK HERE</button>
 </body>
<script>
function alerts(){
   alert("RAGUL TECHNOLOGY");
}
</script>
</html>

OUTPUT





BY CLICKING BELOW DEMO BUTTON YOU CAN PREVIEW THIS ALERT CODE:



0 تعليقات

إرسال تعليق

Post a Comment (0)

أحدث أقدم