HTML <script> digita Attributo

❮ Tag HTML <script>

Esempio

Uno script con l'attributo type specificato:

<script type="application/javascript">
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>

Definizione e utilizzo

L' typeattributo specifica il tipo di script.

L' typeattributo identifica il contenuto tra i tag <script>e .</script>


Supporto del browser

Attribute
type Yes Yes Yes Yes Yes

Sintassi

<script type="scripttype">

Valori di attributo

Value Description
scripttype Specifies the type of the script.

Some common values:
  • A JavaScript MIME type like: application/javascript (default) or application/ecmascript
  • module:
  • Another MIME type. src attribute will be ignored

Look at IANA Media Types for a complete list of standard media types.


❮ Tag HTML <script>