Fixing assumption that $ is jQuery object