Should I include type=“text/javascript” in my SCRIPT tags?

JavascriptWeb DevelopmentFront End Technology

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

This attribute is what is now recommended to indicate the scripting language in use and its value should be set to "text/javascript".

Here you can see how it is used:

      <script language="javascript" type="text/javascript">
            document.write("Hello World!")

Updated on 12-Sep-2019 08:38:14