<select onchange="if(selectedIndex!=0)document.execCommand(value,true,'fason')">
<option>插入控件</option>
<option value="InsertInputButton">普通按钮
<option value="InsertButton">动态按钮
</select>
<option>插入控件</option>
<option value="InsertInputButton">普通按钮
<option value="InsertButton">动态按钮
</select>
<body>
<script>
function getButton(v){
var sB=document.getElementById("sButton")
switch(v){
case "InsertInputButton":sB.innerHTML="<input type='button' value='"+v+"'>"
case "InsertButton":sB.innerHTML="<input type='button' value='"+v+"'>"
}
}
</script>
<select onchange="if(selectedIndex!=0)getButton(value)">
<option>插入控件</option>
<option value="InsertInputButton">普通按钮
<option value="InsertButton">动态按钮
</select>
<span id="sButton"></span>
</body>
function aa(o)
{
if(o.selectedInex==0) return
switch(o.options[o.selectedIndex].value)
{
case "InsertInputButton":
InsertButton.style.display='none'
InsertInputButton.style.display=''
break;
case "InsertButton":
InsertButton.style.display=''
InsertInputButton.style.display='none'
break;
}
}
</script>
<select onchange="aa(this)">
<option>插入控件</option>
<option value="InsertInputButton">普通按钮
<option value="InsertButton">动态按钮
</select>
<input name=InsertInputButton style="display:none"><input name=InsertButton style="display:none" type=button value="InsertButton">
对,我的意思就是你的理解,
而且我这里也有一个可能的例子,
你有兴趣研究研究吗?我的意思是在<textarea>或<input>中出现按钮,
这样就意味着生成的按钮是可编辑的,我可以拖动,改变它的位置!
要放在textarea或input中是不行的,或者你可以用层,把按钮放到层中,再定位
嵌入到了网页中,然后才能实现的,谢谢了!