jquery獲得同源iframe內body下標簽的值的方法
來源:易賢網 閱讀:1452 次 日期:2014-09-26 08:30:32
溫馨提示:易賢網小編為您整理了“jquery獲得同源iframe內body下標簽的值的方法”,方便廣大網友查閱!

test.html

Html代碼

?123456789101112131415161718192021222324 <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jquery</title> <style type="text/css"> </style> <script type="text/javascript" src="> <script type="text/javascript"> $(document).ready(function (){ $("#show").click(function (){ var iframeObj = $(window.frames["iframe_name"].document); alert(iframeObj.find("#un").val()); }); }); </script> </head> <body> <input type="button" id="show" value="show" /> <iframe id="iframe_id" name="iframe_name" src=> </body> </html>

login.html

Html代碼

?1234567891011121314 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>登錄頁面</title> </head> <body> <form method="POST" action="#"> 用戶名:<input id="un" type="text" name="username" value="123d" /> 密 碼:<input type="text" name="password"/> <input type="submit" value="提交"> </form> </body> </html>

更多信息請查看IT技術專欄

更多信息請查看腳本欄目
關于我們 | 聯(lián)系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網