yaasshole 2011-08-23
代码如下:
<head> <title></title> <script src ="Jq/jquery-1.4.2.js" type ="text/javascript" ></script> <script type ="text/javascript"> $(function (){ $("p").click(function (){alert ("小P");}) }); </script> </head> <body> <input type="button" value ="PlayGame" id="btnClick" /> <p>第一个</p> <p>第二个</p> </body>
代码如下:
<head> <title></title> <script src ="Jq/jquery-1.4.2.js" type ="text/javascript" ></script> <script type ="text/javascript"> $(function (){ $(".warning").click(function (){alert("这是警告信息");}); }); </script> <style type="text/css" > .warning{background-color :Yellow ;color :Red ;} </style> </head> <body> <p>没有警告</p> <div class ="warning " >请带好小孩</div> <p class ="warning ">再次警告你</p> <input class ="warning " type ="button" value ="别点啊" /> </body>
代码如下:
<head> <title></title> <script src ="Jq/jquery-1.4.2.js"></script> <script type ="text/javascript" > $(function (){ $(".docc,p,#txt1").click(function (){alert ("不要上当啊");}) }) </script> <style type="text/css" > .docc{background-color :Fuchsia ;color :Olive ;} </style> </head> <body> <p>电脑热卖</p> <input type ="text" id="txt1" /> <input class ="docc" type ="button" value ="上当" /> <input type ="checkbox" /> </body>