When I was working on a front-end project these two days, I wanted to traverse the checkbox on the page through jquery, using the following code:
$("input[type='checkbox'] [name='chk_jvmMachineName']:checked").each(
function() {
val_instanceCodeStr = "," $(this).val( );
}
);
After checking the information online and comparing it, I found that the code was written correctly. Finally, I found that there was an extra space between [type='checkbox'] [name='chk_jvmMachineName'], which resulted in the checkbox object not being obtained
Jquery multiple selectors cannot be separated by spaces