This article is mainly on the JavaScript to obtain an IFRAME in the page elements of the value of the method is introduced, need friends can come to the reference, I hope to help you.
ie method: document.frames[' MyFrame '].document.getelementbyid (' test '). Value; Firefox method: document.getElementById (' MyFrame '). ContentWindow.document.getElementById (' Test '). Value; IE, Firefox method: Code as follows: function GetValue () { var tmp = ''; if (document.frames) { &NBS P TMP + = "Brother IE said: '; tmp + document.frames[' myframe '].document.getelemen Tbyid (' Test '). Value; }else{ &NBS P TMP = document.getElementById (' MyFrame '). ContentWindow.document.getElementById (' test ') .value; } alert (TMP); } Sample code: Code in a.html page code as follows: <html> <head> &NBS P <meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "> <title> &NBSP ; JavaScript get the value of the elements in the IFRAME page test </title> </head> &NBSP;<BODY> ; <iframe id= "MyFrame" src= ' b.html ' style= "width:300px;height:50" px; " ></iframe> <input type= "button" id= "btn" onclick= "Getv Alue () "value=" Test "> <script type=" Text/javascript "> &N Bsp &NBSP; function GetValue () { &NB Sp var tmp = '; if (document.frames) {&NB Sp TMP + + brother said: '; &NB Sp TMP = = document.frames[' myframe '].document.getelementbyid (' test '). Value; }else{ &NB Sp TMP = document.ge Telementbyid (' MyFrame '). ContentWindow.document.getElementById (' test ') .value; &NBSP } & nbsp Alert (TMP); & nbsp </script> </body> </htm The code code for the l> b.html page is as follows: <html> <head > <meta http-equiv= "Content-type content=" text/html; Charset=utf-8 "> <title> &NBSP ; I am an iframe page </title> &N Bsp </head> <body> <input type= ' text ' id= ' test ' value= ' welcome: justflyhigh.com ' > & nbsp </body> </html>