HTML <script>タイプ属性
例
type属性が指定されたスクリプト:
<script type="application/javascript">
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
定義と使用法
このtype
属性は、スクリプトのタイプを指定します。
このtype
属性は、タグ
<script>
と</script>
タグの間のコンテンツを識別します。
ブラウザのサポート
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
構文
<script type="scripttype">
属性値
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>タグ