I'm having trouble using an ascii character reference (®
) in an image title. It works fine when you set it via the html body, but when trying to do the same thing via javascript does not work.
check the sscce:
<style type="text/css">body {background-color:black;}</style>
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js"></script>
<p>this image has the correct ascii character title:<br /><img src="http://www.prototypejs.org/images/logo-home.gif" id="img1" title="®" /></p>
<p>but why can't I set the same value via javascript?<br /><img src="http://www.prototypejs.org/images/logo-home.gif" id="img2" /></p>
<script type="text/javascript">
$("img2").title = "®";
</script>
Thanks.