【发布时间】:2012-12-20 20:21:57
【问题描述】:
我可以使用按钮使字体加粗,但在使用 select 标签选择字体时不能。我有一系列的选择,如 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>
【问题讨论】:
-
不知道你想要达到什么目的......可能想要制作屏幕截图之类的。