How to Remove an Attribute With JavaScript
- 1). Right-click the HTML file you want to edit and select "Open With." Double-click the HTML editor you want to use to set up the JavaScript.
- 2). Type the following code in the body of the HTML file:
<script type="text/javascript"> </script>
These two tags tell the browser to run JavaScript code when the page loads. - 3). Type the following code within the JavaScript tags to edit and clear an attribute:
document.getElementById("elementname").style.border = "";
Replace "elementname" with the HTML element you want to edit. In this example, the element's border is cleared. You can use any of the attribute styles included with HTML elements.
Source...