Home > Web Front-end > JS Tutorial > Several ways to parse Jquery to obtain elements in iframe_jquery

Several ways to parse Jquery to obtain elements in iframe_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:30:16
Original
1471 people have browsed it

DOM method:
Parent window operation IFRAME: window.frames["iframeSon"].document
IFRAME operation parent window: window.parent.document
jquery method:
Select all input boxes in the IFRAME in the parent window: $(window.frames["iframeSon"].document).find(" :text");
Operation in IFRAME to select all input boxes in the parent window: $(window.parent.document).find(":text");
iframe HTML:

1. Select all radio buttons in the IFRAME in the parent window
$(window.frames["iframe1"].document).find("input[@type=' radio']").attr("checked","true");

2. Select all radio buttons in the parent window in the IFRAME
$(window.parent.document).find("input[@type='radio']") .attr("checked","true");
iframe frame:

Copy code The code is as follows:

jquery-1.2.6.js" src="../js/jquery-1.2.6.js" type="text/ecmascript"> 
Statement of this Website
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template