Compare two strings : String comparisons « String « JavaScript Tutorial






<HTML>
<BODY>
<SCRIPT language="JavaScript">
<!--
var myVar="AA";


if(myVar=="AA") {
    window.alert("AA");
} else  {
    window.alert("Not AA");
}

//-->
</SCRIPT>
</BODY>
</HTML>








6.2.String comparisons
6.2.1.Compare two strings
6.2.2.String comparisons
6.2.3.String comparisons by converting strings to its uppercase form
6.2.4.localeCompare
6.2.5.Use if statement with String.localeCompare