So I want to do something that would allow me to have a form or text field ( tag in html) and basically I can type something into that field and have something else happen
For example:
if (x === "something") {
then do this set of instructions
}
if (x === "something else") {
then do this different set of instructions
}
else {
alert("Some error message")
}
In the example above, is it possible to do something where I can type "something" and have it do that set on instructions but not show the alert in the else {} statement?
The different sets of instructions are different and the "something" and "something else" are also different, but the x is in reference to the tag which is inside a tag.
But basically if any of the "if" statements are met, do not execute the "else" statement. But if any of the "if" statements are not met, then execute the else statement. Not sure if it's possible, but I have no clue, just started working with js, so sorry if this is a very basic thing.