Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS special char output

Status
Not open for further replies.

mattquantic

Programmer
Mar 28, 2004
196
GB
Hi. All of my dropdowns are generated dynamically. But, html chars like the degree symbol don't come out right if I use JS... but come out fine in html.

For example -
<form name="thisForm" method="post" action="">
<input type="Text" value="&deg; f">
<input type="Text" value="" name="temp1">
</form>

<script type="text/javascript" language="JavaScript">
document.thisForm.temp1.value = "&deg;";
</script>

Is there a way to get it to render the symbol properly?

M@)
 
document.thisForm.temp1.value = String.fromCharCode(176)

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top