Since you are attempting to execute each
as a property of $
and are getting the following error,
Uncaught TypeError: Cannot call method 'each' of undefined
we can assume that $
is undefined. This is often caused by not including the jquery library in your project.