if(case) {
//statement
} else if {
//statement
}
for() {
//loop to create more else if statements
}
else {
}
Just curious to know if this should/can be done.
Example usage: If the user is making a selection from a dropdown list with values from 1-50, and there are different conditions to be executed onchange for each of those 50 values; else-if statements are then dynamically created using the for-loop for all those 50 different conditions.
===============================================================
Edit:
Great, thanks everyone. You just helped me save a great deal of time that I otherwise would've wasted trying to get this to work somehow; until eventually realizing it can't be done.
The only reason I tried something like this was because I didn't want to write 50+ else-if statements for each of my dropdown option.
Thank you Jonas W, Shane_IL for your answers.
if elsewill appear insideforloop