简体   繁体   English

如何在IE8中添加带有原型的contentEditabled div

[英]How to add contentEditabled div with prototype in IE8

I have the following piece of code: 我有以下代码:

<form action="/fake" >
    <div id="root">
    </div>
</form>

<script type="text/javascript">
    var root = Element.extend($("root"));

    function addTextControl()
    {
      var textCtl = new Element('div', { 'contenteditable': 'true'}).update("Next page");
      root.appendChild(textCtl);
    };

    addTextControl();
</script>

It works perfectly in FF and Chrome, but not in IE8 :-(. What is the problem with it? 它在FF和Chrome中完美运行,但在IE8中没有:-(。它有什么问题?

Thank you in advance 先感谢您

Would you believe it's a casing issue? 您认为这是套管问题吗?

Try this instead: 试试这个:

new Element('div', { 'contentEditable': 'true'})...

Note the capital E in contentEditable. 注意contentEditable中的大写字母E。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM