Prev Demo
JavaScript
>
Function
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Creating function to show alert</h1> <script> function AlertMe() { alert("I am displaying from alert method"); } </script> <input type="button" id="btnTest" onclick="AlertMe()" value="ClickMe!" /> </body> </html>
Note: We DO NOT save your trial code in our database.
Output