.removeProp()
methodThe .removeProp()
method in jQuery is used to remove a proprerty for the set of matched elements.
.removeProp()
method Syntax.removeProp(propertyName)
propertyName
: The name of the property to remove.
.removeProp()
method ExamplesIn this example, we will set a numeric property on a paragraph and then remove it.
<p> </p> <script> var $para = $("p"); $para.prop("luggageCode", 1234); $para.append("The secret luggage code is: ", String($para.prop("luggageCode")), ". "); $para.removeProp("luggageCode"); $para.append("Now the secret luggage code is: ", String($para.prop("luggageCode")), ". "); //The secret luggage code is: 1234. Now the secret luggage code is: undefined. </script>