![](/img/trans.png)
[英]Why is document.execCommand("paste") not working in Google Chrome?
[英]document.execCommand paste not working in contentEditable div
document.execCommand
粘貼不起作用,即,僅當做出選擇並替換所選內容時才起作用,否則不做任何更改。 順便說一句,我在嘗試這樣做的地方使用了一個contenteditable
div元素。
在所有瀏覽器中,它都會失敗,我在單擊ul
的特定li
元素時會使用它。
<ul>
<li>
<a href="javascript:void(0)"onclick="paste();"><span>Paste</span></a>
</li>
</ul>
我在哪里使用粘貼功能: document.execCommand('paste',false,null);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.