I want to make a filter which works with a checkbox. When the checkbox is checked it should show some elements and when its not it should hide it.
This is the code I've got so far but I cant get it to work properly. Anyone who can help me out?
The html what got to hide/show
<li class="verwijder" class="kleding"><img class="aanbieding" src="images/jack.png"><span id="timer"></span></li>
The checkbox
<input id="checkboxeten" type="checkbox" name="filter" value="eten"><br>
Javascript
$(document).ready(function(){
if (document.getElementById("checkboxeten").checked = true) {
$( ".kleding" ).show();
} else {
$( ".kleding" ).hide();
}
});