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

Popular posts from this blog

Using Progress Bar In C#

Get elements by class name in javascript

Jquery serer side datatables in asp.net