Should I include language="javascript" in my SCRIPT tags?

JavascriptWeb DevelopmentFront End Technology

The language attribute in JavaScript is optional since the introduction of HTML5 brought some new improvements. JavaScript became the default language for HTML5 and modern browsers. Therefore, now adding javascript isn’t required in <script> tag.

This attribute specifies what scripting language you are using. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.

Here you can see how it is used:

<html>
   <body>
      <script>
         <!--
            document.write("Hello World!")
         //-->
      </script>
   </body>
</html>
raja
Published on 09-Jan-2018 14:55:36
Advertisements