I am trying to build a little black jack assistant but the error messages are not throwing and if there is an input it always says hit me! Help please thank you in advance.
<script>
function count(){
var base=0;
var input= document.getElementById("input").value;
var total= base + input;
try{
if (isNaN(input)){
throw "Input is not a number";
}
if(input=""){
throw "Input is empty!";
}
if(total=""){
throw "No value added!";
}
document.getElementById("total").innerHTML = total;
if (total >= 14){
document.getElementById("command").innerHTML= "Hold on";
}else{
document.getElementById("command").innerHTML= "Hit me!";
}}
catch(err){
document.getElementById("error").innerHTML= err;
}}
</script>