removeAttribute()





js/script.js
  • function funMake() {
  •  document.getElementById('p1').removeAttribute('style');
  • }
  • function funMake() {
  •  document.getElementById('p1').removeAttribute('style');
  • }


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <script src="js/script.js"></script>
  • </head>
  • <body>
  •  <p id="p1" style="color: red">Hello World!</p>
  •  <script>
  •   funMake();
  •  </script>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <script src="js/script.js"></script>
  • </head>
  • <body>
  •  <p id="p1" style="color: red">Hello World!</p>
  •  <script>
  •   funMake();
  •  </script>
  • </body>
  • </html>