获取触发事件的元素的ID
<html> <head> <script type="text/javascript" src="starterkit/jquery.js"></script> <script type="text/javascript"> $(document).ready(function () { $("a").click(function () { var test = caller.id; alert(test.val()); }); }); </script> </head> <body> <form class="item" id="aaa"> <input class="title"></input> </form> <form class="item" id="bbb"> <input class="title"></input> </form> </body></html>
test
"aaa"
"bbb"
qq_花开花谢_0
相关分类