<html> <head> <title>Comparing two strings</title> <script type="text/javascript"> var a = "C"; var b = "J"; if (a == b) { var identity = "same"; } else { var identity = "different"; } document.write(a + " and " + b + ": " + identity); </script> </head> <body> </body> </html>