![]() |
Knowledge Programming JavaScript . if (then) else |
|
|
||||||||||||||||||
|
Conditional execution is used whenever the flow of the
program depends on some variables. |
|||||||||||||||||
|
if(condition) |
|||||||||||||||||
|
if (myVariable == 10) //
use the proper comparision operator (see below)
|
|||||||||||||||||
|
Accept a form only if the user has filled-in the required email field if (emailVariable == '') //
important : use the == operator to compare, not the = to assign for a complete check email example click here
|
|||||||||||||||||