jquery checkbox listener not working on programmatically change 1

jquery checkbox listener not working on programmatically change

$(".myCheckbox").prop("checked", true).trigger("change")

Here is what the above code is Doing:
1. It’s selecting all the checkboxes with the class “myCheckbox”
2. It’s setting the “checked” property to true
3. It’s triggering the “change” event

The “change” event is what makes the checkbox appear checked.

Similar Posts