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

JavaScript Introduction to jQuery DOM Manipulation Changing Styles

Junmin Lee
Junmin Lee
1,544 Points

Not working in other editor

When I launch the workspace and try the toggleClass code, it works fine But when I use my own editor, the toggle does not work. does anybody else have a similar issue?

Justin Radcliffe
Justin Radcliffe
18,987 Points

Hey Junmin, be sure you're correctly linking to both the css and js files in your index.html.

Ari Misha
Ari Misha
19,323 Points

Hiya Junmin! Like Justine said , be sure to link the code. Also did you download the files from the workspace in order to get you up and running with the existing code you need to work with?

1 Answer

Alejandro Narvaja
PLUS
Alejandro Narvaja
Courses Plus Student 7,340 Points

The first thing you have to do in your code editor is to link to the jQuery CDN by adding this line in your HTML:

<script
  src="https://code.jquery.com/jquery-3.2.1.min.js"
  integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
  crossorigin="anonymous"></script>

That should work everything you use with jQuery.