User input is stored in variable "a". "rightUsr" is a regex condition to check a required input.
How do I make it as if “a[user input] “ does not match it should alert "something went wrong" in if block, and in else block it should print "welcome!"
if(a.match(rightUsr) ){
document.write("Welcome")
}
else{
alert("something went wrong!")
}