HTML- Attribut vom Typ <script>
Beispiel
Ein Skript mit dem angegebenen type-Attribut:
<script type="application/javascript">
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
Definition und Verwendung
Das type
Attribut gibt den Typ des Skripts an.
Das type
Attribut identifiziert den Inhalt zwischen den Tags
<script>
und .</script>
Browser-Unterstützung
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Syntax
<script type="scripttype">
Attributwerte
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. |
❮ HTML <script>-Tag