Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Why when I copy and paste this codepen code into sublime text does the modal not work?

I am trying to get the code from this codepen (https://codepen.io/vajkri/pen/OPYqav) to work on my own computer. I am using sublime text and i have an index.html, modal.css, and a modal js and put each code into its own respective files and link them properly. but all that I get is the background and modal button, but when I click it nothing happens....

1 Answer

you need import JQUERY why ? because he using JQUERY in his JavaScript just check his code :) $ selector, .on() method and .....

also you can inspect his project and you will see

//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js

Thanks for the answer! how exactly do I import the jquery? is it the same <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>?

i hope this is just joke how u can search something on codepen and use it ? without knowing Basics ? go to Official JQuery site and find CND or download JQuery and direct link to it and i hope you use HTML 5 i never saw type in html 5 but okey

example :

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>

This wasn't a joke Im pretty new to JavaScript

then sorry and you should go true Basic Course here in TeamTreeHouse and then go to API´s or Find inspiration on codepen