how to disable a span using jquery/javascript. The script
$('#spanid').attr("disabled", 'disabled');
works fine on IE but doesnt work on firefox.
You cannot disable
a <span>
. The disabled
attribute only works for input elemens. What are you trying to achieve there ?
The only thing I can imagine is that you've got some event bindings on that <span>
, to remove those you can call jQuerys .unbind()
, .die()
and/or .undelegate()
.
$('#spanid').unbind().undelegate().die();
That would remove any event handler (bound directly or via delegation). The only problem here is, that you would to manually store the event handler functions if you want to "enable" it later on again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With