在js自定义函数中使用$(event.target)代替$(this)

2020-11-15 06:07

阅读:697

标签:com   http   blog   class   style   div   img   code   java   javascript   tar   

soscw.com,搜素材
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>
soscw.com,搜素材

 

在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


评论


亲,登录后才可以留言!