HTML <script> ketik Atribut
Contoh
Skrip dengan atribut type yang ditentukan:
<script type="application/javascript">
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
Definisi dan Penggunaan
Atribut type
menentukan jenis skrip.
Atribut type
mengidentifikasi konten antara
<script>
dan </script>
tag.
Dukungan Peramban
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Sintaksis
<script type="scripttype">
Nilai Atribut
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 <script> HTML