Link to home
Start Free TrialLog in
Avatar of tekgrl
tekgrl

asked on

Why this error?: Uncaught TypeError: Cannot read property 'parents' of null

Why am I getting the following JS error: Uncaught TypeError: Cannot read property 'parents' of null

Here is the code I'm using:

https://codepen.io/asna_farid/pen/fKChk
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

That Code Pen is not generating an error that I can see. What are the steps to reproduce?
Avatar of tekgrl
tekgrl

ASKER

Added javascript to external file.
Make sure you have a reference to jQuery in your file if you're working outside of CodePen:

<script src="https://code.jquery.com/jquery-3.3.1.min.js" ></script>

Open in new window

I don't understand your response - where is the error?
ASKER CERTIFIED SOLUTION
Avatar of tekgrl
tekgrl

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is not necessary - all that was required it to change the $ for the document ready to jQuery and pass $ as a parameter.

jQuery(function($) {
 // Use $ as much as you want here
});

Open in new window