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 trialPatrick Hayes
7,061 PointsAdding on() to the $(".controls ul ") on line 6 doesn't work
Hi,
I'm not sure what I'm doing wrong here.
I've appended the code on line 6 to llok like this: $(".controls ul").on("click", "li", function() {... });
It works in the preview but when I check the answer it returns a null value.
Any help would be greatly appreciated.
Cheers
2 Answers
Gareth Borcherds
9,372 PointsAlthough that will also work, they are just looking for
$('.controls').on('click', 'li'. function (){
//etc
You gotta remember that code challenges sometimes look for a specific text and sometimes a correct answer isn't programmed so just try a different solution if you can think of one.
Patrick Hayes
7,061 PointsAwesome Cheers for that. That works great