The following code works in Firefox 3.6, but not in Internet Explorer 8:
<html>
<head>
<title>Example</title>
<script type="text/javascript">
function init() {
alert(document.designMode);
document.designMode = "on";
alert(document.designMode);
}
</script>
</head>
<body onload="init()">
</body>
</html>
In FF the alerts show ‘off’, then ‘on’; in IE they’re both ‘Off’.
What am I doing wrong?
Even though this won’t change what the alerts show, it will turn on an editable mode in IE:
You can test by placing some dummy content in the page body (like
<p>Test</p>) and loading in both FF and IE. It’s a suitable workaround for at least IE8.