我想确定所选文本(在Firefox中)是否为粗体?例如:
<p>Some <b>text is typed</b> here</p>
<p>Some <span style="font-weight: bold">more text is typed</span> here</p>
Run Code Online (Sandbox Code Playgroud)
用户可以选择粗体文本的一部分,也可以选择完整的粗体文本.这是我想要做的:
function isSelectedBold(){
var r = window.getSelection().getRangeAt(0);
// then what?
}
Run Code Online (Sandbox Code Playgroud)
请你帮助我好吗?
谢谢
Srikanth