JQuery -- this 和 $(this) 的区别
来源:互联网 发布:关于淘宝店铺转让 编辑:程序博客网 时间:2024/05/21 22:25
<script type="text/javascript"> $(document).ready(function(){ $("div").each(function(){ alert($(this).html() + "----" + this.tagName + "--" + $(this)[0].id); alert((this == $(this)[0])); $(this).attr("title", $(this).html()); }); }); </script> </head> <body> <div id="node1">sss1</div> <div id="node2">sss2</div> </body>#这里的this其实是一个Html元素(div),获取html属性值均可用this.属性名来取值
#这里的$(this)是一个JQuery对象,可以调用JQuery的方法
# this == $(this)[0] 返回为true
#JQuery拥有attr()方法可以get/set DOM对象的属性
- JQuery 中this 和 $(this) 的区别
- JQuery -- this 和 $(this) 的区别
- JQuery this 和 $(this) 的区别
- JQuery -- this 和 $(this) 的区别
- JQuery -- this 和 $(this) 的区别
- JQuery -- this 和 $(this) 的区别
- jquery里面的$(this) 和this区别
- JQuery -- this 和 $(this) 的区别
- JQuery -- this 和 $(this) 的区别
- JQuery -- this 和 $(this) 的区别
- jquery $(this)和this的区别
- JQuery -- this 和 $(this) 的区别
- jquery中$this和$(this)的区别
- jquery中this 和 $this 的区别
- JQuery -- this 和 $(this) 的区别
- JQuery中$(this)和this的区别
- JQuery -- this 和 $(this) 的区别
- JQuery -- this 和 $(this) 的区别
- javascript中的setAttribute()浏览器的兼容性问题
- C语言中的空指针、空指针常量、NULL & 0
- perl :施瓦茨变换,多级排序:首先按照第一列排序,第一列相等的按照第二列排序............
- js中event.keyCode用法及keyCode对照表
- 算法之冒泡排序
- JQuery -- this 和 $(this) 的区别
- SecurityException: Neither nor current process has android.permission.INSTALL_PACKAGES
- Spherical covariance Gaussians
- 迷失自我的小羔羊~~~
- 23种设计模式学习—abstract factory模式
- CF 253B B. Physics Practical
- 编程之美——数组循环移位
- aiml解析之 Linux C++ libaiml 编译+执行测试程序+支持中文
- Nios/uCOS II笔记---uCOS移植