首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >select如何选中option后自动跳转到对应的网页?

select如何选中option后自动跳转到对应的网页?

提问于 2020-02-25 23:18:13
回答 0关注 0查看 312

大家好!

我自己用html5编了一个程序。想实现的功能是通过选择select下的option,选中后,网页主体位置显示跳转到相对应的网页,但由于本人编程经验不足,还想请教各位大侠如何实现。源代码如下,

其中同目录下已经放置了包含了主文件及test1.html,test2.html,test3.html共计4个文件

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8"/>

<title>select触发链接</title>

</head>

<body style="margin: 0">

<table style="background: DarkGray;width: 100%;height: 890px;">

<tr style="background: Cornsilk">

<td colspan="3" style="height: 10%;text-align:center;margin:50px 0; font:normal 56px/56px 'MicroSoft YaHei'">标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题</td>

</tr>

<tr>

<td style="background: Cornsilk; width:12%; text-align:center;margin:50px 0; font:normal 24px/24px 'MicroSoft YaHei';color:#ffffff">

<form action="" >

<select name='capital' >

<option value='test1'>网页1</option>

<option value='test2'>网页2</option>

<option value='test3'>网页3</option>

</select>

</form>

</td>

<td colspan="2">

<iframe

src="test1.html"; width="100%"; height="100%" name="test"

></iframe>

</td>

</tr>

<tr style="background: Cornsilk"><td colspan="3" style="height: 2%"></td>

</tr>

</table>

</body>

</html>

非常感谢!

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档