This seems like overkill and I would like to refactor this...any suggestions
if($(this).text() == \"Grocery\"){ $(\".type_changer\").attr(\"id\",
Use class instead of id as inner wrapper
use array to store your custom text for matching later
$('.selector').each(function() {}
in this way you can make process common
use array replace method
from = ['Grocery','Restaurant'] to = ['gro','res']