<script> tag vs <script type = 'text/javascript'> tag

Viewed 138350

I was just wondering, what is the difference between

<script>

and

<script type = 'text/javascript'>

Is it different for different webservers?

For example,(I know it's incorrect to provide a link from w3schools, but look)

http://www.w3schools.com/js/tryit.asp?filename=tryjs_myfirst

Using chrome, I visited w3schools and I realised that the <script> tag is all I need.

However, when I did an offline javascript test, i realised that i need the

<script type = 'text/javascript'>

tag. Why is this so?

5 Answers

You only need <script></script> Tag that's it. <script type="text/javascript"></script> is not a valid HTML tag, so for best SEO practice use <script></script>

Related