name | {String} | The name of the property |
value | {Any} [optional] | A value to be set. Most values will be converted to a String before setting. Functions will be evaluted with (previousValue, index) and the return value will be set. |
Value or DollarJS (chainable)
$('input').prop('checked')
$('input').prop('checked', true)
$('input').prop('checked', function(previousValue, index){ return true; })
If value is provided, this will set the property on each element and return the current set for chaining
If value is not passed, this will return the value of the property for the first element in the current set
There is a difference between attr vs prop