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:

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
That Code Pen is not generating an error that I can see. What are the steps to reproduce?
tekgrlAuthor Commented:
Added javascript to external file.
Michael VasilevskySolutions ArchitectCommented:
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

Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

Julian HansenCommented:
I don't understand your response - where is the error?
tekgrlAuthor Commented:
I fixed the error by replacing all instances of "$" with "jQuery". Thanks for the help, everybody.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.