idstr = "\" id=\"556e697175657e537472696e67";     // new image creation ID
 
    grngMaster.execCommand("InsertImage", false, idstr);
    elmImage = globalDoc.all['556e697175657e537472696e67'];以上是HTMLEDIT里的一段,主要是先插入一个空的带ID的IMG对象,然后就可以访问它了,并修改它的SRC,width等属性

解决方案 »

  1.   

    <div id="test" onclick="this.document.execCommand('InsertImage', false, 'http://community.csdn.net/images/CSDN_logo.GIF')">ddfsdff</div>
    路径是自己定义的
      

  2.   

    document.images[0].src
    ...
    document.images[document.images.length-1].src
      

  3.   

    function doInsertImage(){
        var src = 'file:///C:/My Pictures/dance.gif';
        var id = ("s"+Math.random()).replace(/[^\d\w]/g,"");
        var str = src + "\" id=\""+id;
        document.execCommand("InsertImage", false, str);
        var e = document.all[id];
        alert(e.src)
    }
      

  4.   

    我就是要用document.execCommand("InsertImage",true)中属性为true的方式 由用户选择图片插入.
    to ttyp: id这样设么<img id="556e697175657e537472696e67">?