How to access iframe checkbox elements

前端 未结 4 1371
情话喂你
情话喂你 2021-01-21 05:27

I have a web page that consists of a checkbox (parent) and on this same web page, I also have a iframe that is sourced from another page that displays a number of records, which

4条回答
  •  甜味超标
    2021-01-21 06:18

    This works perfectly well

    $("#select_checkbox").change(function(event){
        $("#content").contents().find(':checkbox').each(function(){
            jQuery(this).attr('checked', $("#select_checkbox").is(':checked'));
        });
    });
    

    where select_checkbox is the id of the parent checkbox, content is the id of the frame

提交回复
热议问题