I’m a pretty experienced developer, but this problem is driving me bonkers. I’m trying to use the onclick event to change the HTML up arrow special character to a down arrow when clicked, and vice versa ( i.e. ↑ <–> ↓ ). Here’s what I’m currently doing:
[CODE]
<script type=”text/javascript”>
//<![CDATA[
if(document.all) {
if (document.getElementById(‘FundedSortArrow’).innerText == ‘↑’) {
document.getElementById(‘FundedSortArrow’).innerText = ‘↓’;
}
else {
document.getElementById(‘FundedSortArrow’).innerText = ‘↑’;
}
}
else {
if (document.getElementById(‘FundedSortArrow’).textContent == ‘↑’) {
document.getElementById(‘FundedSortArrow’).textContent = ‘↓’;
}
else {
document.getElementById(‘FundedSortArrow’).textContent = ‘↑’;
}
}
//]]>
</script>
What happens is that the special characters are taken literally, so ↑ and ↓ are printed to the screen instead of what they are intended to represent.
I understand I could be using the tertiary operator, etc., to make everything more elegant, but that’s not what I’m after here.
Thanks for any help that you can provide.
bubbis