This problem seem to happen only in chrome This is the iframe code
This works :
Note that I used $(window).load
to ensure the iframe was loaded. Using load on document
wouldn't ensure the iframe is loaded.
Of course, your iframe must have the same origin as the parent document (which also means you must open your file in http://
in your browser and not file://
).
EDIT : Working demo