MightyPork MightyPork - 11 months ago 27
HTML Question

What other types can <script> have?

I've been wondering about this for quite a while, finally going to find out ;)

We have

<script type="text/javascript">...</script>

I have never seen any type but
, and sometimes the type attribute is even missing, defaulting to javascript anyway.

So, the question:

Is there any other use for the
attribute - any other script we can use?


Available types are:

  • text/javascript
  • text/ecmascript
  • application/javascript
  • application/ecmascript

If you don't specify type, text/javascript is used.

Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script