I'm very new to programming and am trying to write an application for a decimal to hexadecimal converter. When you type a number into a number box (in base 10) and you see the base-16 equivalent appearing as the value in the box change. I cannot figure out how to make my program run. Any suggestions would be greatly appreciated! HTML:
Base Ten:
<input type="number" id="base10" onkeydown="convertBase10to16()">
<br>Base Sixteen:
<input id='base16'>
Javascript:
var base10 =
document.getElementById("base10");
var base16 =
document.getElementById("base16");
var convertBase10to16() = {function () {
if (id("base10").value !== '')
{id("base16").value = parseInt(id("base10").value,10).toString(16);}
};
idwithout defining it. You should check the errors in your JavaScript console to try to solve your problems first; see How to open the JavaScript console in different browsers?