How do I add jQuery to codepen?

I’m making my tribute site and would like to add so jQuerr. What are the steps?


Do you know how to add Bootstrap?

1 Like

go to your pen page

Settings > Javascript > Quick-add > Save & close


See the Pen Steve Jobs Tribute Page by Vincent Collins (@Tillix) on CodePen.

This is my tribute page. I’m trying to add type effeect to the quote.

Hello @Tillix7, the <p id="example1"></p> you added in the javascript section of your pen shouldn’t be there it can break the code, you either append it to something or fix in your html section and call it using javascript and most importantly, make sure you add the cdn link on the javascript

Okay I’ll try that. How does the page look so far?

Love your layout and the color scheme…cheers

Thanks, but it’s still not working. I’m adding the CDN to the html and it’s still not working.

In lines 3-5 of your HTML, get rid of

<script src=""></script>
<script src="jquery-3.1.1.min.js"></script>
<script src="typeit.js"></script> 

(The last two just cause errors because it’s not a full path). Copy and go to Settings > JavaScript, click the black +add another resource button toward the bottom right of the modal and paste it into the field. Make sure it’s listed AFTER jQuery.

If you read the documentation, you’ll see you can either put your strings to be typed out in the HTML or in the JavaScript. Anything put in HTML will override whatever is in the JS. It’s better to have it in the HTML I think (in case JS is disabled they can still read it without the effect)

Thank you so MUCH! :slight_smile:

No problem! :smiley: You can now get rid of all script tags in your HTML. In fact lines 1-9 (everything above the opening <section> tag) can be gotten rid of. Also get rid of the closing </div> before the closing </section> tag as there is already a closing </div> at the bottom of the page. (In fact consider moving the closing </section> tag to the very bottom of the page.)

Consider changing

<span class="type-it"><h2 class=text-center> "Innovation distinguishes between a leader and a follower."</h2></span> 

to (because the <center> is deprecated.)

<h2 class="text-center type-it">"Innovation distinguishes between a leader and a follower.&quot;</h2>
<img class="mx-auto d-block" src="" />

And on the transparent image of Steve Jobs change

<p><img style="float:left" src=""  />
<!-- Lorem Ipsum stuff --> </p>


<img class="float-left img-fluid" src="" />
<p> <!-- Lorem ipsum stuff --> </p>

These classes on the images help them look better on phones and stuff :smiley:

I would say first off that you should start off by using the jQuery CDN that can be found here.

Use the Bootstrap CDN.