Custom JS not visible when published

Check developer console for errors. You are most likely missing something.