Jquery sub-forms operate on elements in the parent form

Source: Internet
Author: User

1. Operate the elements in the Child window in the parent window, for example, iframe1 is the ID of IFRAME)
1) select all radio buttons in IFRAME
$ (Window. Frames ["iframe1" cmd.doc ument). Find ("input [@ type = 'Radio ']"). ATTR ("checked", "true ");
2) Remove the CSS attribute class on in the subwindow named top_menu element.
$ (Window. Frames ["iframe1" cmd.doc ument). Find ('. top_menu'). removeclass ("On ");

2. Operate the elements of the parent window in IFRAME
1) select all radio buttons in the parent window
Vertex (w.w.parent.doc ument). Find ("input [@ type = 'Radio ']"). ATTR ("checked", "true ");
2. The parent window element ID is _ m1408 plus the CSS class on.
Vertex (w.w.parent.doc ument). Find ("# _ m1408"). addclass ("On ");

IFRAME framework: <IFRAME src = "http://chenxinwen2006.blog.163.com/blog/test.html" id = "iframe1" width = "700" Height = "300" frameborder = "0" scrolling = "Auto"> </iframe>

It seems that you can also use $ ("# myid", top.doc ument );

The parent form calls the method (right) in iframe to the iddocument. Frames ["right"]. Expand (); parent form: parent;

Sub-form: opener; (window. opener. Reload ();)

Certificate (window.parent.doc ument). Find ("# alimamaifrm"). ATTR ("src", "http://www.163.com ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.