gpt4 book ai didi

javascript - 带有单选按钮的 HTML 页面

转载 作者:行者123 更新时间:2023-11-27 23:49:02 25 4
gpt4 key购买 nike

我正在尝试找出如何让我的单选按钮在您做出选择并点击提交后将我引导至该网页。这是我迄今为止的代码。

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<div data-role="page">
<div data-role="header">
<h1>Radio Buttons</h1>
</div>

<div data-role="main" class="ui-content">
<form method="post" action="demoform.asp">
<fieldset data-role="controlgroup">
<legend>Choose a Website:</legend>
<label for="ESPN.com">ESPN.com</label>
<input type="radio" name="website" id="ESPN.com" value="http://espn.go.com">
<label for="Facebook.com">Facebook.com</label>
<input type="radio" name="website" id="Facebook.com" value="https://www.facebook.com">
<label for="Apple.com">Apple.com</label>
<input type="radio" name="website" id="Apple.com" value="http://www.apple.com">
</fieldset>
<input type="submit" data-inline="true" value="Submit">
</form>
</div>
</div>

</body>
</html>

最佳答案

您应该在输入单选标记内添加事件 onclick = "document.location.href='somepage.htm'"

关于javascript - 带有单选按钮的 HTML 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32873821/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com