Home > Article > Web Front-end > js gets the element and variable values in the html iframe_javascript skills
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!