Gets the property value of the first element in the matching element set or sets one or more properties for each matching element (operates in a similar manner to attr):
With some built-in properties for DOM elements or window objects, the browser may produce an error if the property is attempted to be deleted. jquery first assigns a property of the undefined value, ignoring any errors generated by the browser
If the second argument is callback, then the property value needs to be returned, and the function argument is interpreted as follows:
1: Property name
2: function that returns the value of the property, the first parameter is the index value of the current element, and the second argument is the original property value
Instance:
<! DOCTYPE html>#listDemo {List-Style:none;} #listDemo li{width:350px;height:20px;margin:10px0;background:red;text-align:center;font:400 13px/20px ' Courier New '; color: #FFF;} </style><script type= ' Text/javascript ' > $(function(){ $(' #user '). Prop (' AutoComplete ',function(index,oldattr) {alert (oldattr); }); });</script>
[jquery Method Prop (NAME|PROPERTIES|KEY,VALUE|FN)] This method operates the property of the element itself