var types = { "Grocery": "gro", "Restaurant": "res", "Bar": "bar", "Pizza Delivery": "piz", "Quick Service": "qui", "Retail": "ret", "Salon": "sal" } $(".type_changer").attr("id", types[$(this).text()]);
I understand that the type_changer id class changes to part of this array, but I don't understand types[$(this).text()]
and this line
$(this).parents('.select-holder').find('.text').text($(this).text());
seems pretty .parents , but I'm confused about .parents and .find('.text').text($(this).text());
Trace source share