execCommand 获取 怎么没有人回答呢,不能没有人知道吧? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 怎么没有人回答呢,不能没有人知道吧? 不是不想回答 只因为这个问题我不会... <html><script type="text/javascript">function $(id){ return document.getElementById(id); }function BodyLoad(){ $("iframe_editor").contentWindow.document.designMode = "on";}function SetBold(){ $("iframe_editor").contentWindow.document.execCommand("Bold");}function GetBold(){ alert($("iframe_editor").contentWindow.document.queryCommandValue("Bold"));}</script><body onload="BodyLoad();"><div> <div><iframe id="iframe_editor" height="300px" width="100%" src="about:blank"></iframe></div> <input type="button" value="设置" onclick="SetBold();" /> <input type="button" value="获取" onclick="GetBold();" /></div></body></html> 左侧的焦点图效果 如何用js给struts2标签赋值? 如何向某个网站注入一段js代码? 求教一个简单的正则表达式 谁有javascript作为脚本做ASP的教程,100分就是谁的! 如何判断页面的某个对象是否存在? 用什么属性取得div内的所有html内容。 请问可否在SVG中自定义事件? 欢迎两位斑竹cpplus、beyond_xiruo,希望瞻仰两位的风采! 如何用JS获取JS生成的HTML? 请教一个javascript保存用户输入的问题 js tab 切换问题
<script type="text/javascript">
function $(id){ return document.getElementById(id); }
function BodyLoad(){
$("iframe_editor").contentWindow.document.designMode = "on";
}
function SetBold(){
$("iframe_editor").contentWindow.document.execCommand("Bold");
}
function GetBold(){
alert($("iframe_editor").contentWindow.document.queryCommandValue("Bold"));
}
</script>
<body onload="BodyLoad();">
<div>
<div><iframe id="iframe_editor" height="300px" width="100%" src="about:blank"></iframe></div>
<input type="button" value="设置" onclick="SetBold();" />
<input type="button" value="获取" onclick="GetBold();" />
</div>
</body>
</html>