This is a simple tutorial on how to create a Java Script alert.
In Java Script there is a predefined function called alert() we now just invokes that function. Here we create a button and when button is clicked we call the alert() function with a custom text .
Lets see,
OUTPUT :
Click the button to show an alert box.
In Java Script there is a predefined function called alert() we now just invokes that function. Here we create a button and when button is clicked we call the alert() function with a custom text .
Lets see,
<!DOCTYPE html> <html> <body> <p>Click the button to display an alert box.</p> <button onclick="alert('This is a sample alert !');">Click me</button> </body> </html>
OUTPUT :
Click the button to show an alert box.
No comments:
Post a Comment