Jak mogę zmienić rozmiar ramki iframe od wewnątrz?

Rozwijam się z jquery i natknąłem się na następny problem: dodałem IFrame wewnątrz strony głównej i chcę zmienić ich rozmiar od środka. Próbowałem kilku pomysłów, ale bez powodzenia.

Oto mój kod:

index.html

<html>
    <head>
        <title>Index</title>
    </head>
    <body>
        <iframe id="myframe" src="frame.html" width="100px" height="100px"></frame>
    </body>
</html>

frame.html

<html>
    <head>
        <title>IFrame</title>
        <script>
            document.width = 500;
            document.height = 500;
        </script>
    </head>
    <body>
        <h2>My IFrame</h2>
    </body>
</html>

questionAnswers(3)

yourAnswerToTheQuestion