jquery 中的css()和attr()

atr()是用来获取标签属性的,比如<img>中的src,  <input>中的type,value。它对应于js中的getAtrribute();

css()是用来获取style样式的,比如<img>中的width,<input>中的border,opacity。它对应于js中的document.get...style....

猜你喜欢

转载自blog.csdn.net/kalinux/article/details/84261061