How can I check if a string is contained with my array? Here's how I'm putting the array together...
// get the select
var $dd = $('#product-variants');
if ($dd.length > 0) { // make sure we found the select we were looking for
// save the selected value
var selectedVal = $dd.val();
// get the options and loop through them
var $options = $('option', $dd);
var arrVals = [];
$options.each(function(){
// push each option value and text into an array
arrVals.push({
val: $(this).val(),
text: $(this).text()
});
});
};
I want to check if "Kelly Green" is contained within the array if it is I want to .show a li
$("#select-by-color-list li#kelly-green").show();