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 trialGary A
3,753 PointsNot to be pedantic... but eq(4) isn't the last element... shouldn't it be the 5th element (which happens to be last)?
I think that it should have been stated in the video that directly choosing an element like that isn't really good practice as you often can't guarantee it will be the last one. Also, that goes the same with using $('li span')
to grab the span you just created. It will grab ALL spans inside li elements, which may not be the desired behaviour.
1 Answer
Steven Parker
231,172 PointsBut eq(4) would be the 5th element, since the eq(0) is the first element (index values start at 0).
KRIS NIKOLAISEN
54,971 PointsKRIS NIKOLAISEN
54,971 PointsCan you post a link to the video?