如何向指定的地方插入自定义的HTML 当鼠标放在d与e之间时,点击button===============================请问当鼠标放在d与e之间时你用什么点击button,如果你用鼠标点击button,那么鼠标还在d,e之间吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <DIV id=div1>abcdefgh</DIV><input id="add" type=button onclick="javascript:document.getElementById('div1').innerHTML+='xxtv'" value="插入mp"> object.insertAdjacentHTML(sWhere, sText) 更改div的innerHTML内容,可以用正则表达式替换,显示在d和e之间 <script>var url="http://community.csdn.net";//这是来自用户的数据function add(){ document.getElementById('aa').innerHTML='<mp>'+url+'<mp>';}</script><DIV>abc<span onmouseover="document.getElementById('add').click()">d<span id="aa"></span>e</span>fgh</DIV><input id="add" type=button onclick=add() value="插入mp"> 感谢大家的回复,这个问题我已搞定了.使用pasteHTML最好了.<form name="form1"> <textarea name="txt1">01234567890</textarea> <input name="txt2" value="abc"> <input type="button" value="insert" onclick="document.form1.txt1.focus(); document.selection.createRange().pasteHTML("<mp>"+window.prompt("请输入http:")+<mp>);"> </form> radio和checkbox的使用 请问 :如何获得光标的位置(不选中文本的情况下) JS 哪里是控制显示图片的大小. 如何隐藏图片真实路径? 急!!!!关于XML+JS树形目录的问题 java 如何获取 ACTIVEX事件中传递的参数? 如何动态改变表格中单元格的背景图片?急用! 服务器端怎么执行javascript,我想肯定能,代码见内 我做了一个固定层,是用实际坐标值得,我在800X600,1024X768下都调好位置了,但是。。。。 slideToggle不能显示? 打不开指定窗口? 实在想不通,谁帮我看看啊
<input id="add" type=button onclick="javascript:document.getElementById('div1').innerHTML+='xxtv'" value="插入mp">
var url="http://community.csdn.net";//这是来自用户的数据
function add(){
document.getElementById('aa').innerHTML='<mp>'+url+'<mp>';
}
</script>
<DIV>abc<span onmouseover="document.getElementById('add').click()">d<span id="aa"></span>e</span>fgh</DIV>
<input id="add" type=button onclick=add() value="插入mp">
<form name="form1"> <textarea name="txt1">01234567890</textarea> <input name="txt2" value="abc"> <input type="button" value="insert" onclick="document.form1.txt1.focus(); document.selection.createRange().pasteHTML("<mp>"+window.prompt("请输入http:")+<mp>);"> </form>