This seems like overkill and I would like to refactor this...any suggestions
if($(this).text() == \"Grocery\"){
$(\".type_changer\").attr(\"id\",
Have an array that contains the value (eg: Salon, Grocery) and also contains the replacement (eg: sal, gro) and replace with that. The alternative is to simply take the first 3 letters and lowercase them but this may cause issues with things that contain only 2 letters then a space if we assume you'll be expanding the list, if not you can go with simply lowercasing the first 3 letters. If you need code examples, just say :)