javascript中window.prompt与table连用

kimmy_159 2017-10-03 10:39:38

<head>
<script type = "text/javascript">
var x,y,z, result;
var x=window.prompt("Enter Name:","");
var y=window.prompt("Enter Weight:","0");
var z=window.prompt("Enter Height:","0");
function input(y,z)
{
return y/(z*z);
}
</script>
</head>
<body>

<Center><b><caption>Calculating MBI</caption></b></center>
<table border=1 width=100%>

<tr><th width=20%> Customer Name </th>
<th width=20%> Weight(KGs) </th>
<th width=20%> Height(Meters) </th>
<th width=20%> BMI </th>
<th width=20%> Status </th>
</tr>
<tr>
<script type="text/javascript">

document.write("<td>");
document.write(x);
document.write("</td>");
document.write("<td>");
document.write(y);
document.write("</td>");
document.write("<td>");
document.write(z);
document.write("</td>");
</tr>
</script>
</body>
输入的数据无法显示在表格
...全文
89 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

51,410

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧