Answer the question
In order to leave comments, you need to log in
How to do it so that the action works in the opposite direction?
Hello.
I have code:
$('.pr_water').click(function(){
if($(this).attr('val')=='off'){
$(this).attr('val', 'on');
}
});
<button class="pr_water" val="off">Кнопка</button>
$('.pr_water').click(function(){
if($(this).attr('val')=='on'){
$(this).attr('val', 'off');
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question