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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM