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買阿里雲

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章