【发布时间】:2018-02-26 12:31:03
【问题描述】:
如果插入符号放在词 gallery 上(或在这两个跨度标签之间的另一个词上),我如何使用 jQuery 从跨度元素中获取数据 ID?
<div class="editor" contenteditable="true">
<p>Lorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s, when an unknown printer took a <span data-id="1"></span>galley
of type and scrambled it to make a type specimen book.</p>
<p> It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged.<span data-id-end="1"></span> It was
popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum
passages, and more recently with desktop publishing software like Aldus PageMaker including
versions of Lorem Ipsum.</p>
【问题讨论】:
标签: javascript jquery html contenteditable