Let's take a look at some variables:
var available_options = 'Option A|Option B|Option C|Option D';
var selected_option = 'Option A';
I am interested in using conditionals within functions like this
function checkOption(sel, avail){
var options = avail.split('|');
/* Insert desired code here */
if(sel === options[0] || sel === options[1] || sel === options[2] || sel === options[3])
{
alert('Success!');
}
}
This function can be called as follows
checkOption(selected_option, available_options);