So I'm trying to convert binary to decimal in Javascript:
function binToDec(){
var binary = document.getElementById("binaryInput").value.split("").reverse();
var toDecimal = function(binary) {
return parseInt(binary,2);
}
}
But it's not working out for me... I'm new to JS so I'm not sure what's going on here.
Also, here is the "binaryInput" reference:
<td colspan="2"><input id="binaryInput" type="text" name="First Number" onfocus='onFocusInput(this);'></td>
Thanks for any help!