Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Learning jQuery…Have a few questions Re: Learning jQuery…Have a few questions

#141722
pixelgrid
Participant

just for the trivia , javascript doesnt handle if else if the way you might be used to.

if(condition1){}
else if(condition2){}
else{}

what it does is checks the first if and then makes ever else if a if else in the else statement.
yeah i know its a bit to much, but just internals of javascript.
so what it does is

if(condition1){}
else{
if(condition2){}
else{}
}

you can have a look here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if…else