Style quotesプロパティ
Style オブジェクト
定義と使い方
quotes プロパティは、埋め込み引用の引用符の種類を設定または返します。
構文
quotes プロパティを設定する:
Object.style.quotes="none|string string string string|inherit"
quotes プロパティを返す:
Object.style.quotes
| 值 | 説明 |
|---|---|
| none | デフォルト。"content" プロパティの "open-quote" および "close-quote" の値が引用符を生成しないことを指定します。 |
| string string string string | 使用する引用符を指定します。最初の2つの値は第1レベルの引用ネストを指定し、後半の2つの値は次のレベルの引用ネストを指定します。 |
| inherit | quotes プロパティの値は親要素から継承されます。 |
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
Internet Explorer と Safari を除くすべての主要ブラウザが quotes プロパティをサポートしています。
例
例
引用符を変更:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>初心者向けチュートリアル(example.com)</title>
<script>
function displayResult(){
document.getElementById("q1").style.quotes="'<' '>' '[start]' '[end]'";
}
</script>
</head>
<body>
これは、他の引用要素の中にある<q>引用要素</q>です。
<br>
<button type="button" onclick="displayResult()">引用符を変更</button>
<p><b>注意:</b> この例はIEとSafariでは動作しません。</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>初心者向けチュートリアル(example.com)</title>
<script>
function displayResult(){
document.getElementById("q1").style.quotes="'<' '>' '[start]' '[end]'";
}
</script>
</head>
<body>
これは、他の引用要素の中にある<q>引用要素</q>です。
<br>
<button type="button" onclick="displayResult()">引用符を変更</button>
<p><b>注意:</b> この例はIEとSafariでは動作しません。</p>
</body>
</html>
試してみる »
Style オブジェクト その他の拡張