在js自定义函数中使用$(event.target)代替$(this)
时间:2014-04-29 22:22:27
收藏:0
阅读:615
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script src="http://lib.sinaapp.com/js/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> function myajax(event){ alert($(event.target).html()) } </script> </head> <body> <a class="ajaxa" onclick="myajax(event)" >子栏目和文章</a> </body> </html>
评论(0)