0
I have the following situation:
I need to make sure that by clicking a Jquery button, it analyzes whether a page checkbox is set to true, and if so, make another checkbox also marked as true;
I tried to use the following code, but to no avail:
$("#button").click(function(){
if ($('.box1').is(':checked')) {
$(".box2").prop('checked', true);
}
});
I tried to use the attr function, but it didn’t work either.
The code works. There must be something else preventing it from working properly. Check that Jquery is loaded and is running only after the paging is loaded with
$(function(){ ...
– Isac
Has the html code?
– novic
Is this #button already on the page when jQuery is read? There is only one button with this ID and 1 checkbox for each class?
– Sergio