Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <input type="button" value="OK"> <p>Click the button below to remove the type attribute of the input element above.</p> <button onclick="myFunction()">Try it</button> <p><strong>Note:</strong> When removing the type attribute of an input element, the element will be of type <em>text</em>, which is the default value.</p> <p><strong>Note:</strong> In Internet Explorer 8 and earlier, the removedNamedItem returns the attribute as it should, but it does not remove the attribute.</p> <script> function myFunction() { var btn = document.getElementsByTagName("INPUT")[0]; btn.attributes.removeNamedItem("type"); } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_namednodemap_removenameditem by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:29:13 GMT --> </html>
Result:
Try it Yourself - © w3schools.com