Does anyone know how I can go about doing this...

I have an iframe on my page, with a website inside that you can navigate around. I also have a button on my page. When clicking the button is it possible to grab the current location within the iframe?

For example, the iframe displays mywebsite.com and I navigate within the iframe to mywebsite.com/page4.php. When clicking the button I want it to return mywebsite.com/page4.php that I can then use elsewhere.

Thanks