I'm not clear on what exactly is wrong with the code below.
I want to ask the user to input a text string and to compare that to another text string. Then notify the user whether his string is alphabetically higher or lower than the stored value. When I test this in jsfiddle I only get the second alert message. Why does this happen?
This is my code:
var string1;
var string2;
string1 = prompt("Tell me your string1?");
string2 = "green";
if ("string1" > "string2")
alert("Your string is alphabetically higher");
else
alert("Your string is not alphabetically higher");