当鼠标放在d与e之间时,点击button===============================
请问当鼠标放在d与e之间时你用什么点击button,如果你用鼠标点击button,那么鼠标还在d,e之间吗?

解决方案 »

  1.   

    <DIV id=div1>abcdefgh</DIV>
    <input id="add" type=button onclick="javascript:document.getElementById('div1').innerHTML+='xxtv'" value="插入mp">
      

  2.   

    object.insertAdjacentHTML(sWhere, sText)
      

  3.   

    更改div的innerHTML内容,可以用正则表达式替换,显示在d和e之间
      

  4.   

    <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">
      

  5.   

    感谢大家的回复,这个问题我已搞定了.使用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>