我可以使用按钮使字体加粗,但在使用选择标签选择字体时不能。我有一系列的选择,如 Arial、Times、Courier 等,无法点击。这就是代码的样子
function fontEditor(){
var x=document.getElementById("fontName").selectedIndex;
var y=document.getElementById("fontName").options;
document.execCommand(x,"",y);
edit.document.focus(fontName);
}
伴随着这个
<select id="fontName" onChange="fontEditor('font',[selectedIndex].value)">
<option value="Arial">Arial</option>
<option value="Calibri">Calibri</option>
<option value="Comic Sans MS">Comic Sans MS</option>
</select>