我在做一个编辑器时,想要插入图片,而且这个图片上带有链接。所以我是这样写的:
window.parent.document.execCommand("InsertImage",false,photourl);
window.parent.document.execCommand("CreateLink",false,bigurl);
可有一个问题是,这个带链接的图片上有一圈蓝色的链接的线。
所以我想能不能,给那个图片设一下"border=0",我就想请教一下该怎么写。execCommand说还有一种写法是第三个参数设为“id”,
然后通过document.getElementById('id’)后来操作他的属性。
可是我试了之后,发现建立的img 和 link 都无法取得(得到的都是null),而如果是用的InsertInputImage的话,到是可以取得他的dom对象的。
window.parent.document.execCommand("InsertImage",false,photourl);
window.parent.document.execCommand("CreateLink",false,bigurl);
可有一个问题是,这个带链接的图片上有一圈蓝色的链接的线。
所以我想能不能,给那个图片设一下"border=0",我就想请教一下该怎么写。execCommand说还有一种写法是第三个参数设为“id”,
然后通过document.getElementById('id’)后来操作他的属性。
可是我试了之后,发现建立的img 和 link 都无法取得(得到的都是null),而如果是用的InsertInputImage的话,到是可以取得他的dom对象的。
http://community.csdn.net/Expert/topic/5537/5537613.xml?temp=.196499
font-face: Arial; padding: 3; border-top: solid 1px #3f3f3f; scrollbar-base-color: #E8F2FE;
overflow: auto;" >
</div>
我是通过contenteditable来实现在线编辑的。
如果用range.PasteHTML,改如何来实现呢。
document.createTextRange()具体如何使用?
* img
{
border:0px;
}
document.execCommand("CreateLink",false,bigurl);
比如这个如果我要在js中控制他的文字,target 改如何实现。