I have a little problem that's driving me mad. I have the following example code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<script>
function Test() {
document.getElementById("test").innerHTML = "<input type='text' value='ab'cef'>"
}
</script>
<body>
<div id="test"></div>
</body>
<script>
Test();
</script>
</html>
This example works great in FireFox 3.5, and I get to see an apostrophe in the middle of the text in the Input box. However, IE 7 displays it verbatim as: ap'cef.
I've variously tried different escaping in the vain hope of seeing the apostrophe, for example \x27 or \' without any success. Does any clever person know how to do it in IE?
I realise I could use DOM methods to create nodes, but there's too much code for me to refactor it all.
Thanks!