This article mainly introduces the prop () method usage in jQuery, and analyzes prop () in detail in the form of examples () the functions, definitions, and various common usage techniques for getting or setting matching element attribute values. For more information, see the examples in this article to describe how to use the prop () method in jQuery. Share it with you for your reference. The specific analysis is as follows:
This method can be used to obtain or set the attribute values of matching elements.
The function varies depending on the method parameters.
Syntax structure 1:
When the parameter is an attribute name, this method can match the attribute value specified by the First Matching Element in the element set.
The Code is as follows:
$ ("Selector"). prop (name)
Parameter List:
Parameters |
Description |
Name |
Defines the name of the property whose value you want to obtain. |
Instance code:
Instance 1:
The Code is as follows:
Prop () function-script house