Código
<!DOCTYPE html> <html> <head> <title>Convertidor</title> <style type="text/css"> body { width: 300px; font-family: Helvetica; text-align: center; } input { border: 3px dashed #000080; } input:hover { background-color: #FFFF00; color: #000080; } #grados { display: block; padding: 0 0 8px 0; color: #C00; } </style> <script type="text/javascript" > var grados = document.getElementById("grados"); var conv = document.getElementById("opcion"); function switchLetter() { if (conv.options[conv.selectedIndex].value == 0) { // Aqui algo anda mal!! grados.innerHTML = "C"; } else { grados.innerHTML = "F"; } } </script> </head> <body> <form action="ex2.php" method="post"><fieldset><legend>Convertidor</legend> <input type="text" name="grados" size="4" /> <sup>o</sup><div id="grados"></div> Convert from <select id="opcion" onchange="switchLetter()"> <option value="0">Celsius a Fahr</option> <option value="1">Fahr a Celsius</option> </select></fieldset> </form> </body></html>