One of the HTML contenteditable=false traps __html

Source: Internet
Author: User

Recently developed a new feature, encountered a lot of problems, and so have time will be summarized in turn, one of the problems is that the HTML element of the Contenteditable=false in IE (edge), will occasionally or can be edited situation, check a lot of information to understand, the original in IE, Additional processing must be done:

If there is such a code:

<div contenteditable=true class= "Somedivstyle" >
    <span contenteditable=false class= "SomeSpanStyle" > Aa</span>
</div>

In Chrome, there is no problem, the outside is an editable Div, which contains a not editable span elements, but in IE, this writing will be problematic, we have to rewrite it as follows:

<div contenteditable=true class= "Somedivstyle" >
    <span contenteditable=true class= "SomeSpanStyle" > Aa</span>
</div>

The key is to set the internal element's Contenteditable property to true to ensure that the elements inside are not editable; this is a huge hole ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.