jQuery alert()

This jQuery tutorials teaches you abut the jQuery alert ans how alert box works in jQuery. The given example uses alert boxes to provide information on run time.

jQuery alert()

jQuery alert()

In this jQuery tutorial we will discuss how an alert box works in jQuery. Moreover, this tutorial will discuss in details about alert box in jQuery.

In the given application here, alert boxes have been used to provide information at run time basis. Through this information, the user of the application gets help to perform the tasks further with more information at runtime. Alert box can be popped up after an event happens as for click event or after the completion of a line of code execution. click() function in jQuery is used to bind the click event, JavaScript event.



Here, we will explain jQuery alert with the help of a simple example, ehich would help you understand the concept easily. In this example, we have shown about how an alert box can display information. This example displays an alert box after clicking a button, which generates the click event. When a user executes this example and click on the button, this displays the alert box.


<!DOCTYPE html>
<title>jQuery Alert Example</title>
p { color:red; margin:5px; cursor:pointer; }
p:hover { background:yellow; }
<script type="text/javascript" src="jquery-1.9.1.js"></script>
<script type="text/javascript">
alert("jQuery alert box example !");
<p>Click on button</p>
<button id="b1">Click Here</button>