
當前在#document中,怎么再往上找到input。使用iframe后,找父級元素好像找不到。
uj5u.com熱心網友回復:
由于頁面是動態生成的,input元素id相同,所以不能通過id找,parent.document又會找到多個uj5u.com熱心網友回復:
可以通過type獲取uj5u.com熱心網友回復:
問題已經解決了,給iframe加了name,通過prev找的了uj5u.com熱心網友回復:
送分了~~~
uj5u.com熱心網友回復:
window.parent.document.getElementByname('input') 子找父document.getElementById('iframe').contentWindow.document.getElementByname('input') 父找子
--------------------------
用jquery 的話有簡化版 需要的話自行百度
uj5u.com熱心網友回復:
iframe里面的頁面和父頁面通信:window.postMessagehttps://developer.mozilla.org/zh-CN/docs/Web/API/Window/postMessage
uj5u.com熱心網友回復:
很棒,加油
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/233322.html
標籤:ASP
