javascript交互

cuke 2001-12-21 10:39:47
<html><script>function test(str)
{
alert(str);
}
</script><body>
<input type="button" name="pacert_edit" value="修改" onclick="return test(如何获得"modify"对象?);" >
<input type="hidden" vaule="success" name="modify" id="modify">
</body>
</html>
没有用到form,点击修改,获得"modify"的值,onclick="return test(如何获得"modify"对象)
...全文
70 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
blues-star 2001-12-21
  • 打赏
  • 举报
回复
直接写modify.value就可以啦~

<input type=text name="modify" onclick="alert(modify.value)">

如果没有表单,直接写input的name就可以了~默认的是window

<input type=text name="modify" onclick="alert(window.modify.value)">
cpplus 2001-12-21
  • 打赏
  • 举报
回复
就是用document.all("modify").value 得到 modify 的值的~~~
cpplus 2001-12-21
  • 打赏
  • 举报
回复
<html>
<head>
<script language="javascript">
function test()
{
alert(document.all("modify").value);
}
</script>
</head>
<body>
<form name="form1">
<input type="button" name="pacert_edit" value="修改" onclick="return test();" >
<input type="hidden" value="success" name="modify" id="modify">
</form>
</body>
</html>
ZHANG9652 2001-12-21
  • 打赏
  • 举报
回复
说得明白些好不好,看不懂

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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