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
- First we have to create an html page. For that use any html editor or notepad.
- Create an new page and save it as index.html
- Then create an html tag and next create ah head tag.
- Inside the head tag place the title tag. Title tag is used to show the name of the web page in address box.
- At next we have to create an body tag.
- Inside the body tag we have to create a button.
- For creating button use the button tag (<button> </button>).
- For placing the name of the button write the name inside the button tag. eg: <button> CONVERT </button>.
- Then we have to create an alert. For creating an alert use java script.
- we can use inner java script in html (<script> </script>). Inside the script tag you can write ah peace of code to display alert.
- 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>
إرسال تعليق