jQuery removeProp() 方法

jQuery 教程 · 2019-03-27 17:56:48

实例

添加并移除名为 "color" 的属性:

$("button").click(function(){ var $x = $("div"); $x.prop("color","FF0000"); $x.append("The color 属性: " + $x.prop("color")); $x.removeProp("color"); });

定义和用法

removeProp() 方法移除由 prop() 方法设置的属性。

注意:不要使用该方法来移除诸如 style、id 或 checked 之类的 HTML 属性。请使用 removeAttr() 方法代替。

语法

$(selector).removeProp(property)

参数 描述
property 规定要移除的属性的名称。

点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html

查看所有标签

Lighttpd

Lighttpd

Andre Bogus / Packt Publishing / 2008-10 / 39.99

This is your fast guide to getting started and getting inside the Lighttpd web server. Written from a developer's perspective, this book helps you understand Lighttpd, and get it set up as securely an......一起来看看 《Lighttpd》 这本书的介绍吧!

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具