在js自定义函数中使用$(event.target)代替$(this)
2020-11-15 06:07
                         标签:com   http   blog   class   style   div   img   code   java   javascript   tar      在js自定义函数中使用$(event.target)代替$(this),搜素材,soscw.com 在js自定义函数中使用$(event.target)代替$(this) 标签:com   http   blog   class   style   div   img   code   java   javascript   tar    原文地址:http://www.cnblogs.com/zuoxiaobing/p/3696988.html
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 heretitle>
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>

文章标题:在js自定义函数中使用$(event.target)代替$(this)
文章链接:http://soscw.com/essay/21399.html