<iframe src="1.php" id="1"></iframe> <iframe src="1.php" id="2"></iframe> 

And in the 1.php script, but it takes the id of the first iframe, but it’s necessary that its parent:

 $('html').attr('id', $('iframe',top.document).attr('id')); 

Thank.

    2 answers 2

    Use frameElement to access the element that contains the current page:

     $('html').attr('id', frameElement.id); 
    • Yeah, thanks, read it now. - Stanislaw Kukaew

    So try it.

     <iframe src="1.php?id=2" id="2"></iframe> 

    What to do next - I hope it is clear.

    • The question was not about that. There my regular het is cut off. Thank. - Stanislaw Kukaew
    • @StanislawKukaew And you do not chop off! - Pavel Mayorov