Remove attribute using jquery
To remove attribute from html element using
jquery we can use removeAttr method.
This method accepts attribute name which we want to remove.
<input type="button" value="Remove Attribute" onclick="RmoveAttribute()" />
<div id="myDiv" class="myClass" title="This is a div">
This is a div
</div>
<script type="text/javascript">
function RmoveAttribute() {
$("#myDiv").removeAttr("title"); //This will remove title from div
}
</script>
Comments
Post a Comment