i'm trying to insert an HTML entity into an element using DOM methods only. i'm having trouble getting entities to be parsed instead of being rendered as plain text, e.g. ">" should display as a right-angle-bracket ">", not the literal text ">". using innerHTML instead of nodeValue works, but i want to avoid non-DOM methods.
any ideas?
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
any ideas?
Code:
<html>
<head>
<title>test</title>
<script type="text/javascript">
function foo() {
document.getElementById("somediv").firstChild.nodeValue = ">";
}
</script>
</head>
<body>
<form>
<input type="button" value="foo();" onclick="foo();" />
<div id="somediv"> </div>
</form>
</body>
</html>
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big