<input typt="text" name="userName" width="20">
<a href="javascript:openUrl()">超连接</a></span></td>
<script>
function openUrl()
{
var temp = document.loginForm.userName.value;
window.location.href="abc.html?name="+temp;
}
</script>
本文介绍了一个简单的HTML表单与JavaScript的交互案例。通过输入框获取用户姓名并利用超链接实现页面跳转,同时将获取到的用户名作为参数传递。此案例展示了基本的HTML元素与JavaScript函数之间的交互方式。
<input typt="text" name="userName" width="20">
<a href="javascript:openUrl()">超连接</a></span></td>
<script>
function openUrl()
{
var temp = document.loginForm.userName.value;
window.location.href="abc.html?name="+temp;
}
</script>
1698

被折叠的 条评论
为什么被折叠?