I'm using jQuery to disable hyperlinks if the user isn't allowed to click on them.
The documentation(http://api.jquery.com/attr/) says:
To retrieve and change DOM properties such as the
checked
,selected
, ordisabled
state of form elements, use the.prop()
method.
I assume form elements are <input ...>
elements so not links (<a>
)
And that's why .prop('disabled', true)
doesn't work, while .attr('disabled', 'disabled')
does. However, is it supposed to work? Is there a specification which say that links can be disabled, in which case clicking on them won't have any action? - or is it just something few browsers implement because they're being nice?
If disabled
isn't actually meant to be on links, is there any other easy way to forbid the user clicking on the link, or should I just remove and reattach the href
attribute?