js方法不能与jquery方法同时用

困扰我一天的问题,终于知道原因了:

js方法不能与jquery方法同时用!!!
度娘找到了答案:例如

attr("name") 是jquery对象的方法,原生js的方法是getAttribute()。

代码可以写成$(element).attr("name")或者element.getAttribute("name")。

 

posted @ 2017-12-21 18:02  WentingC  阅读(703)  评论(0)    收藏  举报