【问题标题】:Why does element be deleted together which has the attribute of contenteditable=false为什么具有 contenteditable=false 属性的元素会被一起删除
【发布时间】:2017-06-21 07:04:28
【问题描述】:
<div contenteditable="true">
    <p contenteditable="false">1</p>
    <p contenteditable="false">2</p>
    <p contenteditable="false">3</p>
    <p contenteditable="true">4</p>
    <p contenteditable="true">5</p>
</div>

当我按下“BackSpace”键时,这些具有contenteditable=false属性的连续元素将被全部删除!

而且,如果我将“

”的元素更改为“”的元素,它们的行为会完全不同

这是错误还是特性?

示例:The example of program

以及如何只删除具有 contenteditable=false 属性的“

”元素?

【问题讨论】:

    标签: html contenteditable rich-text-editor


    【解决方案1】:

    对于使用 span 元素的情况,这是使用非块元素时的错误: https://bugzilla.mozilla.org/show_bug.cgi?id=439808

    【讨论】:

      猜你喜欢
      • 2011-01-11
      • 2014-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-26
      • 2013-05-31
      • 2014-04-29
      • 1970-01-01
      相关资源
      最近更新 更多