S
S
student123452016-11-05 21:14:11
Bootstrap
student12345, 2016-11-05 21:14:11

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.4435cf8554c842fab4f9bfaccf336963.PNG

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2016-11-05
@student12345

$('.bla').on('click', function(){
    $(this).text(function(i,text) {
        return text === "Выключить" ? "Включить" : "Выключить";
    });
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question