![](/img/trans.png)
[英]Javascript document.execCommand “bold” not working in chrome
[英]JavaScript document.execCommand() own tags
我發現一些非常有趣! execCommand函數應用了許多有用的功能。 但是可以使用OWN包裹嗎? 喜歡:
document.execCommand("styleWithCSS", false, "<span class='own-class'>");
我發現的所有相關內容都很古老......所以也許你們其中一個人知道一個好的解決方法或者什么。
感謝dandavis。
以下工作非常好:
document.execCommand("insertHTML", false, "<span class='own-class'>"+ document.getSelection()+"</span>");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.