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.
精彩评论