I'm trying to set a button value to be « (or ») via JavaScript with the following code:
document.getElementById('hideButton').value='«';
This just sets the button text to «
rather than «.
The HTML markup works fine (i.e. <input type="button" value="«">
) giving the double left arrow quote on the button face.
Is there some special way of escaping the ampersand code in JavaScript?
Thanks,
FM
here just convert to UTF it should work.
document.getElementById('hideButton').value='\u00AB';
document.getElementById('otherButton').value='\u00BB';
here a link to convert special text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With