Hello, I am trying to figure out how to filter in/out content with checkboxes using jquery. Being very new to jquery I have no idea how to approach this the correct way.
I would like three checkboxes like this:
<div class="check_filter">
<div id="filter">
<input type="checkbox" id="apple" /><label for="apple">Apple</label>
<input type="checkbox" id="pear" /><label for="pear">Pear</label>
<input type="checkbox" id="peach" /><label for="peach">Peach</label>
</div>
</div>
Then I would have the content that could be filtered:
<div id="content" >
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Vestibulum consectetur ipsum sit amet urna euismod imperdiet aliquam urna laoreet.</p>
<p>Curabitur a ipsum ut elit porttitor egestas non vitae libero.</p>
<p>Pellentesque ac sem ac sem tincidunt euismod.</p>
<p>Duis hendrerit purus vitae nibh tincidunt bibendum.</p>
<p>Nullam in nisi sit amet velit placerat laoreet.</p>
<p>Vestibulum posuere ligula non dolor semper vel facilisis orci ultrices.</p>
</div>
I wondering the best way to filter out the data when the checkbox is checked or unchecked.
Thank you for any help on this.