开发者

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 :-(. Wh开发者_开发问答at is the problem with it?

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜