var input = uadd.value; if (input.charAt(0) === '3') { gender = "male"; } else if (input.charAt(0) === '4') { gender = "female"; }