Last active
December 28, 2015 23:19
-
-
Save nickatnight/c77d4bab7d420c736770 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getInput(e){ | |
// only run if the user presses the enter key | |
if(e.keyCode == 13){ | |
// validate input | |
var userIn = document.getElementById("userInput").value; | |
var soul = document.getElementById("sel"); | |
var vally = soul.options[soul.selectedIndex].value; | |
var outFormat; | |
if(document.getElementById("decimal").checked) outFormat = 10; | |
else if(document.getElementById("hexidecimal").checked) outFormat = 16; | |
else outFormat = 2; | |
converter(vally, outFormat, userIn); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment