php - how do items disappear and appear upon select/un-select checkbox? -


Ways to hide / show items on a webpage using jquery on a checkbox (say, with each Many checkboxes are related to its related items)?

Waiting to load some JavaScript code pages in your page, and then for the registers a checkbox On click events and when the value of the checkbox changes, the code looks at the current value and then hides / dislikes other items on the web page

In some instances, to get this new content and then that Can make an AJAX call on the server to put content in the page Is there.

In jQuery, you can do this:

  $ (document) .ready (function () {$ ("# showRelatedItems"). ) {$ (". RelatedItems") Toggle ($ (this) .prop ("check"));});});   

This will work with id = "showRelatedItems and a set of related code with class =" relatedItems ".

Working demo:

Comments