Featured Post

Remove attr,removeAttr in jquery

.removeAttr()
Returns: jQuery
.removeAttr(attributeName)
attributeName An attribute to remove.
Remove an attribute from each element in the set of matched elements.
The .removeAttr() method uses the JavaScript removeAttribute() function, but it has the advantage of being able to be called directly on a jQuery object and it accounts for different attribute naming across browsers.

Note:If attempting to remove an inline 'onclick' event handler using .removeAttr(), one may find that this doesn't achieve the desired effect in Internet Explorer 6,7 or 8. Instead it is recommended to opt for using .prop() to achieve this as follows:

$element.prop("onclick", null);
console.log("onclick property: ", $element[0].onclick);
We may update the behavior of .removeAttr() at some point in the future to better handle this, however for the time being, the above should be considered the standard cross-browser approach to this problem.

Example Demo
Clicking the button enables the input next to it.










teknosys sitaram

Comments

Popular posts from this blog

[Inside AdSense] Understanding your eCPM (effective cost per thousand impress...