1 line
1.7 KiB
JSON
1 line
1.7 KiB
JSON
{"name":"removeProp","type":"method","title":".removeProp()","deprecated":null,"removed":null,"desc":"Remove a property for the set of matched elements.","categories":["attributes","manipulation/general-attributes","version/1.6"],"entries":[{"return":"jQuery","signatures":{"added":"1.6","argument":{"desc":"The name of the property to remove.","name":"propertyName","type":"String"}},"examples":{"desc":"Set a numeric property on a paragraph and then remove it. ","code":"\n$( \"p\" )\n .prop( \"luggageCode\", 1234 )\n .append( \"The secret luggage code is: \", String( $para.prop( \"luggageCode\" ) ), \". \" )\n .removeProp( \"luggageCode\" );\n .append( \"Now the secret luggage code is: \", String( $para.prop( \"luggageCode\" ) ), \". \" );\n","css":"\n img {\n padding: 10px;\n }\n div {\n color: red;\n font-size: 24px;\n }\n","html":"\n <p></p>\n"},"longdesc":"\n <p>The <code>.removeProp()</code> method removes properties set by the <code><a href=\"/prop/\">.prop()</a></code> method.</p>\n <p>With some built-in properties of a DOM element or <code>window</code> object, browsers may generate an error if an attempt is made to remove the property. jQuery first assigns the value <code>undefined</code> to the property and ignores any error the browser generates. In general, it is only necessary to remove custom properties that have been set on an object, and not built-in (native) properties.</p>\n <p><strong>Note:</strong> Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use <code><a href=\"/prop/\">.prop()</a></code> to set these properties to <code>false</code> instead.</p>\n "}]} |