HTML DOM Style quotes 屬性

2018-08-04 20:41 更新

Style quotes 屬性

Style 對象參考手冊 Style 對象

定義和用法

quotes 屬性設(shè)置或返回嵌入引用的引號類型。

語法

設(shè)置 quotes 屬性:

Object.style.quotes="none|string string string string|inherit"

返回 quotes 屬性:

Object.style.quotes

描述
none 默認。規(guī)定 "content" 屬性的 "open-quote" 和 "close-quote" 的值不會產(chǎn)生任何引號。
string string string string 規(guī)定要使用的引號。前兩個值規(guī)定第一級引用嵌套,后兩個值規(guī)定下一級引號嵌套。
inherit quotes 屬性的值從父元素繼承。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


實例

實例

更改引號:

<html>
<head>
<script>
function displayResult()
{
document.getElementById("q1").style.quotes="'<' '>' '[start]' '[end]'";
}
</script>
</head>
<body>

<q id="q1">This is a <q>quoted element</q> in another quoted element.</q>
<br>

<button type="button" onclick="displayResult()">Change quotation marks</button>

</body>
</html>

嘗試一下 ?


Style 對象參考手冊 Style 對象
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號