Get the value of a property for the first element or set one or more properties for every matched element.
// <input type="checkbox" checked>
const isChecked = $('input').prop('checked');
true
$('input').prop('disabled', true);
<input disabled>
$('input').prop('checked', (index, oldVal) => !oldVal);
// Checkbox state is inverted
| Parameter | Type | Description |
|---|---|---|
| name | string | object | The name of the property (e.g., 'checked', 'disabled', 'selectedIndex'), or an object of property-value pairs. |
| value | any | function | The value to set. If a function, it is called for each element with (index, currentValue). |
Returns: The property value for getter, or the original SR object for setter.