Jump to content

Reading an HTML Iframe using Javascript


dizzy1

Recommended Posts

I'm trying to get the content of a iFrame the content will only ever be a single number, I've tried this:

 

 

<script type="text/javascript">	

function GetIframe()	{

var MyIFrameID = document.getElementById('MYIFRAME');

alert(MyIFrameID);					
}
</script>	


<iframe id="MYIFRAME" src="www.MYEXAMPLEPAGE.COM?Food=1&Drink=2" ></iframe>

<button type="button" onclick="GetIframe();">Show </button>

 

 

But the alert message displays: [object HTMLFrameElement]

 

 

Link to comment
https://forums.phpfreaks.com/topic/245778-reading-an-html-iframe-using-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.