I want to apply select2 to a bunch of jquery elements on the page that all have the same class name but it looks like if i call select2() on an element that already has had a select2() called on it then it blows up. here is my code
$('.MyDropdowns').each(function (i, obj) {
$(obj).select2({ width: "455px" });
});
so I want something like:
$('.MyDripdowns').each(function (i, obj) {
if (!$(obj).HasSelect2Initiatized)
{
$(obj).select2({ width: "455px" });
}
});
Does anything like this exist?
if($(obj).is(":visible"))
– Frightselect2()
twice? – Yiddish