Is it possible to add a character entity to an input field using javascript? I've been able to do it statically by just including it in the value attribute of the input tag like this:
<input id="degInput" type="text" value="180°">
However, I'm not able to use setAttribute() to add it dynamically. This is what I tried using JS:
document.getElementById("degInput").setAttribute("value", "360°");
This caused the attribute value "360°" to be added to the input field exactly as it was written in the javascript code, instead of placing a little degrees symbol on the upper right side of "360". I'm learning actual beginner javascript scripting and I'm not interested in jQuerry at the moment. If anyone knows how to tackle this problem, I'd appreciate your help.