HTML <script> typ Atrybut
Przykład
Skrypt z określonym atrybutem type:
<script type="application/javascript">
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
Definicja i użycie
type
Atrybut określa typ skryptu .
type
Atrybut identyfikuje zawartość między
<script>
znacznikami </script>
i .
Obsługa przeglądarki
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Składnia
<script type="scripttype">
Wartości atrybutów
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. |
❮ Znacznik HTML <script>