Home  >  Article  >  Web Front-end  >  js gets the element and variable values ​​​​in the html iframe_javascript skills

js gets the element and variable values ​​​​in the html iframe_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:42:501106browse

Last week I wanted to get the elements and js variable values ​​​​in the iframe, but I couldn’t get it. I checked the information and found out:

You cannot use the $(document).ready() method, but you must use the $("#iframeId").load() method. You can only obtain it after the iframe is loaded.

Get the js variable value in iframe:

document.frames['x'].y

That’s it.

Hey, it’s a very simple question, it took a long time, it shouldn’t be!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn