Let's look at how jquery can bulk bind events to the DOM's various elements
<script language= "JavaScript" >
<!--
$ (document). Ready (function () {
$ ("div"). Click (function () {//$ ("div") is all the div tags in the page
Alert ("Hello world!");
})
})
-->
</SCRIPT>
$ ("div"). Click $ ("div") is all the div tags in the page the sentence is to all the tags for the elements of Div binding a click event that is when all the div is mouse click to execute alert ("Hello world!");
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>jquery Basic Tutorial II (demo mouse click event) </title>
<script language= "javascript" src= "/demo/jquery.js" ></script>
<script language= "JavaScript"
<!--
$ (document). Ready (function () {
$ ("div "). Click (function () {
alert (" Hello world! ");
})
})
//-->
</script>
<body>
<div>hello world!</div>
</body>