moral of the story...jquery can go in javascript function