JQuery Or $ Is Not Defined
It is a common issue in Jquery.

This is because the Jquery file (jquery.min.js) is not available.
jquery.min.js can be not available due to the following reasons.
1. If you havn't added the jquery.min.js file to your page.
2. If you have added the javascript code before the jquery.min.js is loaded.
3. If the jquery.min.js file is modified so that $ is not availalbe.
First of all add the Jquery file (jquery.min.js) to your page.
Adding Jquery file (jquery.min.js) on the Head Section is mostly preferred.
Then place the javascript code inside document.ready inside script tag
This will help the javascript code to execute after the DOM is fully loaded.

Always place your script file beneath the Jquery min file.

This will definitely resolve your issue.