if...then...else...if
<html> <head> <title>if...then...else...if</title> <script type="text/javascript"> var stateCode = 'MO'; if (stateCode == 'OR') { taxPercentage = 3.5; } else if (stateCode == 'CA') { taxPercentage = 5.0; } else if (stateCode == 'MO') { taxPercentage = 1.0; } else { taxPercentage = 2.0; } document.write(taxPercentage); </script> </head> <body> </body> </html>