Atributo de tipo HTML <script>
Exemplo
Um script com o atributo type especificado:
<script type="application/javascript">
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
Definição e uso
O type
atributo especifica o tipo do script.
O type
atributo identifica o conteúdo entre as tags
<script>
e .</script>
Suporte ao navegador
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Sintaxe
<script type="scripttype">
Valores de atributo
Value | Description |
---|---|
scripttype | Specifies the type of the script. Some common values:
Look at IANA Media Types for a complete list of standard media types. |
❮ Tag HTML <script>