Home > Web Front-end > JS Tutorial > Example of usage of removeProp() method in jQuery_jquery

Example of usage of removeProp() method in jQuery_jquery

WBOY
Release: 2016-05-16 16:22:00
Original
1422 people have browsed it

The example in this article describes the usage of the removeProp() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:

This method can delete the properties set by the prop() method.

Syntax:

Copy code The code is as follows:
$("selector").removeProp(name)

Parameter list:

参数 描述
name 定义要要删除的属性名称。

实例:

实例一:

复制代码 代码如下:






脚本之家




   
     
      
     
   
欢迎来到脚本之家

   


以上代码可以删除td的width属性。

实例二:

复制代码 代码如下:






脚本之家





   
     
      
     
   
欢迎来到脚本之家

   


以上代码并没有删除td的width属性,这是因为removeProp()只能删除由prop()方法设置的属性。

希望本文所述对大家的jQuery程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template