开发者

ContentEditable Div Error just in Opera

开发者 https://www.devze.com 2023-04-03 23:10 出处:网络
I got a problem with a contenteditable div in Opera. I can edit the div when it contains content, but Ican\'t do anything when the div is empty?

I got a problem with a contenteditable div in Opera. I can edit the div when it contains content, but I can't do anything when the div is empty?

<div contenteditable=true></div>

Any workarounds or libr开发者_如何学Cary for this problem?


Just fix your markup, <div/> is not correct enclosing tag.

<div contenteditable=true></div>

It looks like Opera doesn't allow you to edit content of elements that were not properly enclosed.


you need to create a text node inside with length > 0 to write its not just in opera

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号