F
F
Flagname2020-04-25 16:59:44
JavaScript
Flagname, 2020-04-25 16:59:44

How do I change the text of a checkbox when I click it?

my version doesn't work, I don't know what I'm doing wrong, Google doesn't help either
https://jsfiddle.net/r7fjyo1h/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
Qu1eeeOJ, 2020-04-25
@Qu1eeeOJ

You selected javascript but didn't select the jQuery library, which caused $ - to be undefined.
The error is that you have not correctly selected the element, that is, =>
You wrote: $('subscribeNews').click(function() {
Needed: $('#subscribeNews').click(function() {
Now it will work click on the checkbox, then I think you google.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question