阿里云9.9元云服务器限时购买

JS操作iframe父级子级元素,jquery自动点击iframe里按钮

在父窗口中操作 选中iframe中的id

$(window.frames["ifm"].document).find("#id").attr("value",$("#id").val());

在iframe中操作 选中父窗口中的所有单选钮 

$(window.parent.document).find("input[@type='radio']").attr("checked","true"); 
$("#父级某id",parent.document).trigger("click");//获取iframe外层标签元素,并自动触发点击事件

 

HTML

  <iframe id="ifm" src="https://mee" frameborder="0" width="100%" height="100%" allowfullscreen="true" allowtransparency="true" scrolling="no">
            </iframe>

 用自己私人的服务器来测试吧,99买阿里云

posted @ 2020-11-27 13:46  HIIT  阅读(1599)  评论(0编辑  收藏  举报
阿里云限时红包 最高 ¥ 2000 云产品通用红包,可叠加官网常规优惠使用