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 Pagination & Content Filter

Harry Beckwith
Harry Beckwith
13,452 Points

Pagination & Content Filter JavaScript Project 2

Hi,

I am stuck on Pagination & Content Filter JavaScript Project 2 full stack JavaScript developer.

I am trying to filter the number of students that are displayed based on the page number clicked.

Heres a link to my code pen http://codepen.io/fun/pen/pbwvYo?editors=1111

Any advice would be appreciated.

Thank you =)

2 Answers

Graham Wright
seal-mask
.a{fill-rule:evenodd;}techdegree
Graham Wright
Full Stack JavaScript Techdegree Student 15,197 Points

I just put something together for this project. I went the route of adding a class to the list items that matched the search query [using the :contains() selector. https://api.jquery.com/contains-selector/]. Then I could count up items with that class to get my array for paginating.

Harry Beckwith
Harry Beckwith
13,452 Points

Thank you, will try and put into place over the weekend!