skip to Main Content

jQuery, change class text of checked checkboxes

My HTML is generated by the website and I can't change this: <div> <span class="wrapper"> <input type="checkbox" value="" id="nr1" name="X"> <label for="X"> <span class="Y"> <span class="title">Text nr 1</span> </span> </label> </span> </div> I'm trying to use jQuery to change the…

VIEW QUESTION

How to combine jquery selector with 'this'

I want to combine these two statements into one. $("#thing1, #thing2").toggleClass('myClass'); $(this).toggleClass('myClass'); Instincts told me this might work: $("#thing1, #thing2", this).toggleClass('myClass'); but after some research, I discovered it is equivalent to this: $(this).find("#thing1, #thing2").toggleClass('myClass'); I can't find anything in the…

VIEW QUESTION

toggleClass doesn't work with display:block – Jquery

I have 4 divs which have style="display: none" property and when I try to change the property to display: block through toggleClass it doesn't works. JS: $(document).ready(function () { $("#add_client").click(function () { $("#inputs").toggleClass("shown"); }); $("#show_clients").click(function () { $("#show_information").toggleClass("shown"); }); $("#show_free_rooms").click(function…

VIEW QUESTION
Back To Top
Search