jquery click 当前对象
$(this)即是当前点击的对象。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <script type="text/javascript" src="jquery-1.2.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(":input").click(function(){ alert($(this).attr("name")); }) }); </script> </HEAD> <BODY> <input type="button" name="test1" value="test1"> <input type="button" name="test2" value="test2"> <input type="button" name="test3" value="test3"> <input type="button" name="test4" value="test4"> <input type="button" name="test5" value="test5"> <input type="button" name="test6" value="test6"> </BODY> </HTML>
refurl:http://bbs.csdn.net/topics/320146000
相关推荐
opspider 2020-06-28
ZHANGRENXIANG00 2020-06-28
明瞳 2020-06-10
lanzhusiyu 2020-06-09
HSdiana 2020-06-03
PengQ 2020-05-26
lengyu0 2020-05-20
HSdiana 2020-05-11
haidaoxianzi 2020-04-18
PioneerFan 2020-04-09
HSdiana 2020-03-28
百年da孤独 2020-03-27
lwb 2020-03-26
haocxy 2020-03-08
spinachcqb 2020-03-06
柳永法的个人 2020-02-13
qsdnet我想学编程 2020-01-29
wwwxuewen 2020-01-19