Dan Andrews
2007-06-04 17:09:55 UTC
Hello,
I was wondering what is the correct way to handle special characters
via javascript and the DOM. I would like to avoid document.write and
innerHTML. What I am doing is dynamically creating options for a
select. The innerHTML example below works for firefox and internet
explorer, but is this the accepted way of dynamically adding special
characters.
option = document.createElement("OPTION");
// option.appendChild(document.createTextNode("é - example"));
option.innerHTML = "é - example";
Thanks,
Dan Andrews
I was wondering what is the correct way to handle special characters
via javascript and the DOM. I would like to avoid document.write and
innerHTML. What I am doing is dynamically creating options for a
select. The innerHTML example below works for firefox and internet
explorer, but is this the accepted way of dynamically adding special
characters.
option = document.createElement("OPTION");
// option.appendChild(document.createTextNode("é - example"));
option.innerHTML = "é - example";
Thanks,
Dan Andrews