Edit The Code:
See Result »
Try it Yourself - ©
w3ii.com
<
!DOCTYPE
html
>
<
html
>
<
body
>
<
p
>
Click the button to display an alert box:
<
/p
>
<
button
onclick
="myFunction()"
>
Try it
<
/button
>
<
script
>
function
myFunction() {
alert(
"I am an alert box!"
);
}
<
/script
>
<
/body
>
<
/html
>
<!DOCTYPE html> <html> <body> <p>Click the button to display an alert box:</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { alert("I am an alert box!"); } </script> </body> </html>