if
... else
StatementThe if
... else
statement provides a mechanism to execute statements under all conditions that do not match a preceding if or else if statements(s). Since it is a catch-all provision, it does not evaluate an expression.
<script language="JavaScript"> <!-- function checkOptions(selectedValue) { if (selectedValue == 1) { alert("You selected 1."); } else { alert("You didn't select 1."); } } //--> </script>