Site icon Dotnet Helpers

removeAttr() Method

.removeAttr()

Remove an attribute from each element in the set of matched elements.

HTML :

<table border=”1″>
<tr><td>This is first table</td></tr>
</table>

JQUERY:

$(document).ready(function() {

$(“table”).removeAttr(“border”);

});

OUTPUT DOM :

<table>
<tr><td>This is first table</td></tr>
</table>

NOTE :

From above JQ, removeAttr() remove th border attribute in the selected table

Exit mobile version