Javascript examples for DOM HTML Element:IFrame
IFrame src Property - Get the URL of the document that is shown in an iframe:
<!DOCTYPE html> <html> <body> <iframe id="myFrame" srcdoc="<p>Hello world!</p>" src="http://java2s.com"></iframe> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w ww.ja va 2 s .c o m*/ var v = document.getElementById("myFrame").src; console.log(v); } </script> </body> </html>