There are actually selectors like this:
#checkbox1:checked + .checkbox-label How to select them with jquery? This type of code does not work:
$('#checkbox1:checked + .checkbox-label').css({ // здесь провожу манипуляции с css }) There are actually selectors like this:
#checkbox1:checked + .checkbox-label How to select them with jquery? This type of code does not work:
$('#checkbox1:checked + .checkbox-label').css({ // здесь провожу манипуляции с css }) Your code is a working example by reference jsfiddle
May not work due to the fact that no matching item was found. In order to understand why the corresponding part of HTML is not working.
I will explain on #checkbox1:checked + .checkbox-label . This is a selector (“prev + next”). It searches for the element "next", which is after the element "prev" within the common "parent".
Those. if we place prev and next in different blocks, the code will not work.
Source: https://ru.stackoverflow.com/questions/744499/
All Articles