Home > Article > Web Front-end > What does prop mean in jquery
jQuery is a cross-browser JavaScript library that simplifies operations between HTML and JavaScript. There are many methods in this library. Below I will take you to understand the prop() method.
The prop() method is used to set or return the attributes and values of the selected element.
When this method is used to return an attribute value, the value of the first matching element is returned.
When this method is used to set attribute values, one or more attribute/value pairs are set for the set of matching elements.
jquery basic learning tutorial
Syntax
Return the value of the attribute:
$(selector).prop(property)
Set properties and values:
$(selector).prop(property,value)
Set properties and values using functions:
$(selector).prop(property,function(index,currentvalue))
Set multiple properties and values:
$(selector).prop({property:value, property:value,...})
The above is the detailed content of What does prop mean in jquery. For more information, please follow other related articles on the PHP Chinese website!