In Firefox, you can insert a degree symbol as follows:
"00B0" is the hexadecimal value of the degree symbol's index in the Unicode character set.
You can append it to output like so:
myOutput += "\u00B0";
You may need to modify it for other browsers, but it's a start. Hope this helps.