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

Can someone help understand how jQuery is doing this???

Video here: http://www.screencast.com/t/eKusQgMMC0

Table filtering?

Would I build the table in HTML, Style with CSS, and filter it with jQuery?

What functions would I use?

1 Answer

Hi Philip,

So the short answer is YES. HTML table, style with CSS and filter with jQuery or plain JavaScript.

I would put a separate class for each filter option on the row I want to show, then show and hide them with the jQuery .hide() and .show() methods.

For example, on the row elements you want to show when "Lower Division" is selected add the class "lower-division". Then when it is pressed you can show all rows with this class and hide the rest.

Something like:

$("#btn-lower-division").click(function(){
   $('TR').hide();
   $('.lower-division').show();
}).

Hope this helps . . . Lonnie

How would I reset?