【发布时间】:2019-11-14 16:58:06
【问题描述】:
我需要避免在内容可编辑<p> 中拖放文本我的示例HTML 代码如下,我的内容可编辑<p> 有单独的<span> 如下。
<div class="row">
<p id="" class="given" contenteditable="true"><span>Lorem</span> <span>trst</span> <span>Lorem</span> <span>Lorem</span> <span>Lorem</span> <span>Lorem</span> </p>
</div>
你可以在这张图片中看到,我可以选择文本并将其拖放到另一个地方,我需要避免那个可拖动的选项。
我看过几篇关于这个的帖子,
Disable drag and drop of selected text
How can I prevent text/element selection with cursor drag
我需要使用 jQuery 来做到这一点。我该怎么做呢
【问题讨论】:
标签: javascript jquery html contenteditable paragraph