The following method is used to attached the click event to the button:
Hello world alert box example(HelloAlert.html)
Here is the video instruction of running the example program - How to display alert message in jQuery?
Description of the program
For using jQuery script ,we write it inside <script> tag. The below code checks whether the page loading is finished (DOM elements are ready or fully loaded) and if page loading is finished then it executes the code in the block.
// Your code here
The Html page contains a button named "cl", when click event is triggered on this element , it will display a alert box showing message "Hello World". The "alert()" function of jQuery creates a alert box having provided message.
Learn from experts! Attend jQuery Training classes.
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: September 2, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles