Tested on
- IE 6.0
- Firefox 1.5, 2.0
- Opera 9
- Safari 2.0
Examples
-
Play with readonly attribute
@readonly = null. You can write in input field.
$("#t1+a").toggle( function(){ $(this).prev("input").attr("readonly", "readonly"); }, function(){ $(this).prev("input").removeAttr("readonly"); } );
-
Remove simple attribute with removeAttr() method
Click for remove my background-color !
$("#t2").click(function() { $(this).removeAttr("class") });
When I use jQuery's removeAttr() method, if you click on paragraph then his background-color is remove, except under IE. -
Remove the same attribute with attr() method
Click for remove my background-color !
$("#t3").click(function() { $(this).attr("class", "") });
With this code, paragraph's background-color is removed, under IE too.