怎么把html的一个页面中的一个标签的id的值传递给另一个html页面,并使用
答案:3 悬赏:50
解决时间 2021-02-19 18:19
- 提问者网友:情系雨樱花
- 2021-02-19 03:33
a.html页面<br><html><br><head><br><script type="text/javascript"><br>function show(){<br> var id=document.getElementById("rid").value;<br> alert("uRole="+id);<br>}<br></script><br><br></head><br><br><body><br><table><br> <tr><br> <td><select id="rid" name="uRole" ><br> <option id="rid" value="0">员工</option><br> <option id="rid" value="1">管理员</option><br> <option id="rid" value="2">超级管理员</option></select></td></tr><br> <tr><br> <td><button onclick="show()">确认</button></td></tr><br> <td><a href="b.html'">跳转</a></td><br> </table><br></body><br></html><br><br>b.html页面<br><br><html> <br><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>b.html</title></head><script type="text/javascript">function show(){ var id=document.getElementById("rid").value; alert("uRole="+id); }</script><body><form id="thisform" name="thisform"> <table> <tr> <td><a href="a.html">提交</a></td> </tr> <tr> <td><button onclick="show()">参数显示</button></td></tr> </table></form> <br></body></html>
最佳答案
- 二级知识专家网友:丢不掉的轻狂
- 2021-02-19 04:27
把uRole的值通过地址栏传递
跳转
b.html页面通过判断uRole的值来辨别是员工、管理员、超级管理员
b.html页面通过判断uRole的值来辨别是员工、管理员、超级管理员
全部回答
- 1楼网友:一池湖水
- 2021-02-19 06:21
可以把a.html放到一个iframe中,这样可以通过iframe使用
- 2楼网友:啵啵桃汀
- 2021-02-19 04:45
sdfsdf
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯