天天看點

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 規定要使用的引号。前兩個值規定第一級引用嵌套,後兩個值規定下一級引号嵌套。
inherit quotes 屬性的值從父元素繼承。

浏覽器支援

Style quotes 屬性
Style quotes 屬性
Style quotes 屬性
Style quotes 屬性
Style quotes 屬性

所有主要浏覽器都支援 quotes 屬性,除了 Internet Explorer 和 Safari。

執行個體

更改引号:

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>菜鳥教程(runoob.com)</title>

<script>

function displayResult(){

    document.getElementById("q1").style.quotes="'<' '>' '[start]' '[end]'";

}

</script>

</head>

<body>

<q id="q1">這是一個<q>引号元素</q> 在其他的引号元素内。</q>

<br>

<button type="button" onclick="displayResult()">修改引号标記</button>

<p><b>注意:</b> 這個例子在IE和Safari不工作。</p>

</body>

</html>

Style 對象