在您拥有包含文本area的iframe的网页中,使用javaScript
此代码获取iframe参考,并动态标识iframe是使用contentwindow或contentDocument。 It then assigns the reference to the inside variable.
With the inside variable, you can now access the elements within the iFrame and, in this specific case, the textarea:
function iframeRef( frameRef ) { return frameRef.contentWindow ? frameRef.contentWindow.document : frameRef.contentDocument } var inside = iframeRef( document.getElementById('one') )
This comprehensive solution provides reliable access to elements inside iFrames, regardless of their runtime-changing IDs or名称。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3