jquery $(this).attr $(this).val方法

来源:互联网 发布:青岛seo外包 编辑:程序博客网 时间:2024/06/10 14:52
$(this).attr(key); 获取节点属性名的值,相当于getAttribute(key)方法 
$(this).attr(key, value); 设置节点属性的值,相当于setAttribute(key,value)方法 

$(this).val();获取某个元素节点的value值,相当于$(this).attr(“value”); 
$(this).val(value);设置某个元素节点的value值,相当于$(this).attr(“value”,value);
0 0