To-do list adapted from jQuery tutorial not working


#1

For practice I made some minor changes (changing CSS styling, changing IDs to classes, removing unneccessary type specifications) to the code used in the jQuery tutorial creating a to-do list and entered the CSS, JS, and HTML into CodePen. View the CodePen result. My version doesn’t add a list item below the form box upon clicking submit in CodePen, but the exact code works in the Codecademy editor.
Does anyone know the reason behind this discrepancy? There must be something going on behind the scenes I’m not aware of…


#2

Hello :slight_smile:

jQuery is an external JavaScript library. Codecademy includes jQuery into user workspaces automatically.

To add jQuery to your codepen please select Settings from the top menu, open JavaScript tab and type jQuery in the search box in the section Add External Scripts/Pens and select the first result.

You can also add jQuery explicitly - add this script tag just before the </body> tag:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.