Possible Duplicate:
Alt attribute encoding with JavaScript
I can't seem to assign special characters using javascript in alt tags and have them render in any browser.
Without javascript, special characters in alt tags render fine (Pepsi™):
<img id="pic" src="path/to/image.jpg" alt="Pepsi™" />
However, when assigning this same value via javascript or jquery you get (Coke™
).
$("#pic").attr("alt","Coke™")
or image = document.getElementById('pic'); image.alt="Pepsi™"
This issue exists in chrome and IE6; I haven't tried other browsers. Any ideas?