jQuery中this与$(this)的区别实例

 1 <!doctype html>
 2 <html>
 3 <head>
 4 <meta charset="utf-8">
 5 <title>this</title>
 6 <script type="text/javascript" src="js/jquery.js"></script>
 7 </head>
 8 <body>
 9 <input type="text" id="dd" value="gg"/>
10 <script>
11    $("#dd").click(
12      function(){
13         alert("this取值:"+this.value+"--"+this);//this是js中返回html对象,所以要这样用。
14        alert("$(this)取值:"+$(this).val()+"--"+$(this));//$(this)返回封装后的jquery对象,所以要用jquery的方法。
15      }
16    )
17 </script>
18 </body>
19 </html>
原文地址:https://www.cnblogs.com/dreamflower/p/5506157.html