Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Practice Data Pagination!
You have completed Practice Data Pagination!
Preview
This final video shows one solution for switching through different pages of data using the event listener.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
set it equal to the button that
currently holds the active class.
0:00
I did this using querySelector
on the pagination list.
0:02
To help with step 9, I stored whether
the user has clicked a button or
0:07
not in a variable named buttonClicked.
0:11
I use the closest method here on the
event.target with button as the argument.
0:13
This ensures the user can click in between
the buttons without triggering the event.
0:18
If you're unfamiliar
with the closest method,
0:23
definitely check out the link
in the teacher's notes below.
0:25
It's a very useful tool.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up