Answer the question
In order to leave comments, you need to log in
How to make it so that when you click on "enable" the text changes to "off", and vice versa?
Hello! I can not understand. I have such a task: When you click on "enable" the text should change to "off", and vice versa. Help me please.
Answer the question
In order to leave comments, you need to log in
$('.bla').on('click', function(){
$(this).text(function(i,text) {
return text === "Выключить" ? "Включить" : "Выключить";
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question