0
How i can add a alert message when i click clickme button
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body bgcolor="red"> <h1><u>ABHIMANAM</u></h1> <ol> <li>sayooj</li> <li>simal</li> <li>juriaj</li> <li>prv</li> <li>amal</li> <li>shagil</li> </ol> <input type="button" value="clickme" onclick="button"/> </body> </html>
4 ответов
+ 2
You can do that with a js function
function abc(){
alert()
}
And add to the button onclick = "abc()"
+ 1
How i can add a alert message when i click clickme button
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body bgcolor="red">
<h1><u>ABHIMANAM</u></h1>
<ol>
<li>sayooj</li>
<li>simal</li>
<li>juriaj</li>
<li>prv</li>
<li>amal</li>
<li>shagil</li>
</ol>
<input type="button" value="clickme"
onclick="button() "/>
<script>
function button () {
alert("CODHACKER");
}
//your code here...
</script>
</body>
</html>
0
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<button id = "demo"> click me </button>
</body>
<script>
x= document.getElementById("demo");
x.addEventListener("click",function (){
alert("hello world");
});
</script>
</html>