Home  >  Article  >  Web Front-end  >  document.selection.createrange.text为空时怎么pastehtml?_html/css_WEB-ITnose

document.selection.createrange.text为空时怎么pastehtml?_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:23:161646browse

document.selection.createrange.text为空时,也就是没有选中任何内容,只有一个光标,这个时候想插入一段html怎么办?pastehtml "font会没有效果的!

当然如果选中了内容是可行的。


回复讨论(解决方案)

当我没问!内容为空时忘记添加内容了,所以看不见,其实html已经加进去了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn