注:火狐可运行,谷歌不可运行(安全级别高)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript 弹窗案例</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" >
function choose()
{
window.open("2.html", "", "width=300,height=150")
}
</script>
</head>
<body>
学号:<input type="text" id="sid"><br>
姓名:<input type="text" id="sname"><br>
<input type="button" value="选择" onclick="choose();">
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" >
function choose(a,b)
{
var fw=window.opener;//返回对创建该窗口的 Window 对象的引用
fw.document.getElementById("sid").value=a;
fw.document.getElementById("sname").value=b;
window.close();
}
</script>
</head>
<body>
<table border="1" bordercolor="blue" width="100%" >
<tr>
<th> </th><th>学号</th><th>姓名</th>
</tr>
<tr>
<td><input type="button" value="选择" onclick="choose('001','张三');"></td>
<td>001</td><td>张三</td>
</tr>
<tr>
<td><input type="button" value="选择" onclick="choose('002','李四');"></td>
<td>002</td><td>李四</td>
</tr>
<tr>
<td><input type="button" value="选择" onclick="choose('003','王五');"></td>
<td>003</td><td>王五</td>
</tr>
</table>
</body>
</html>

  运行示意:

最新文章

  1. [原]分享一下我和MongoDB与Redis那些事
  2. iOS8沙盒路径的变化
  3. Android LitePal 神一般的数据库框架 超级好用
  4. SQL复杂查询和视图(2)
  5. Spark RDD Operations(1)
  6. PHP获取某年第几周的开始日期和结束日期
  7. 三星Mega 6.3(i9200)删除kingroot
  8. Linux 下 MySQL 的彻底卸载和安装配置字符集
  9. Unity3D研究院之与Android相互传递消息
  10. LetterView实现载入全国各地城市
  11. error: /usr/include/objc/objc-class.h: No such file or directory
  12. Echarts使用随笔(1)-Echarts中markPoint的使用(静态、动态)-effect
  13. linux_Ubuntu 12.04 安装jdk
  14. Android 关于ListView中按钮监听的优化问题(方法一)
  15. 5、范围标签&lt;fieldset&gt;&lt;/fieldset&gt;
  16. PHP 命名空间以及自动加载(自动调用的函数,来include文件)
  17. 201521123069 《Java程序设计》 第6周学习总结
  18. Kubernetes存储之Persistent Volumes简介
  19. OxyPlot Controller OxyPlot控制器
  20. rt-thread中软件定时器组件超时界限的一点理解

热门文章

  1. Java for LeetCode 210 Course Schedule II
  2. Can&#39;t bind to local 8700 for debugger报错和解决
  3. UVALive 4953 Wormly--【提醒自己看题要仔细】
  4. 【C语言】指针
  5. 一次工作中用到的Highcharts.Chart
  6. Android笔记:获取屏幕信息
  7. moogodb3.x总结
  8. java https tomcat 单双认证(含证书生成和代码实现) 原创转载请备注,谢谢O(∩_∩)O
  9. JavaWeb学习--Servlet认识
  10. 按键使用方法(二)------verilog