F
F
Flagname2020-05-01 14:28:28
JavaScript
Flagname, 2020-05-01 14:28:28

How can I make the text change when the checkbox is clicked?

I can't figure out what is wrong in my code.
https://jsfiddle.net/bsx72uj5/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2020-05-01
@Flagname

Add jQuery to the resources and everything will work
5eac0a17af076034646713.jpeg
well, and you can use a more concise solution:

$('#subscribeNews').click(function() {
  $('.rememberMe').text($(this).is(':checked') && 'новый текст' || 'напомнить мне');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question