$(document).find(".new-switchery-stock").each(function(k,v) { var elems = $(document).find('.new-switchery-stock'+k); var switchery = new Switchery(elems[0]); });