Im using jQuery to disable an option in a select drop down list. I need to know the difference between using
prop('disabled','disabled')
and
prop('disabled',true)
Both pretty much work on all browsers (not sure if I’ve missed any tho), but on another post I was he say use disable, true. Can someone please elabarate? Thanks
According to the W3C forms specification, the disabled attribute is a boolean attribute,
so
prop('disabled',true)is right.prop('disabled','disabled')also works because the string'disabled'evaluates to true.