I am trying to assign a function to a property to group items using .prop()
$('.whatever').prop({MyProp:MyFunc});
By carefully studying the documentation for this function, it seems that there is a special behavior when the value is a function, and a function is NOT assigned to the property, and the function returns a value.
Is there an easy way for this or should I just use
$('.whatever').each(function(id, item){item.MyProp=MyFunc;});
source share