Answer the question
In order to leave comments, you need to log in
Why doesn't if else work with .text?
The function only fires once, but the else block doesn't work anymore. What is the problem?
$(".column__continue-read").click(() => {
if ($(event.target).text("Continue reading")) {
$(event.target).text("Close");
} else {
$(event.target).text("Сontinue reading");
}
});
Answer the question
In order to leave comments, you need to log in
You are event
not transmitting.
$(".column__continue-read").click((event) => {
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question