Sunday, January 16, 2011

How to write this in jquery “window.parent.document.getElementById('parentPrice').innerHTML”?

I have an iframe and I wrote this code


to access parent element. How to get the same result using jquery?
UPDATE: Or how to access iFrame parent page using jquery?

To find in the parent of the iFrame use:

$('#parentPrice', window.parent.document).html();

The second parameter for the $() wrapper is the context in which to search. This defaults to document.

Courtesy :

1 comment:

  1. It works for me as well...

    $("button", window.parent.document).click(function()
    alert("Functionality defined by def");