javascript里关于参数传递问题

zifengling 2002-02-23 09:56:10
各位大虾们,我想问一下,在javascript里有一个form的select元素,现在我又要求在javascript里调用这个select元素,请问可否实现。谢谢。
...全文
28 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
孟子E章 2002-02-25
  • 打赏
  • 举报
回复
没有明白你的意思,请详细说明!
zifengling 2002-02-23
  • 打赏
  • 举报
回复
我的意思你们没弄明白,例如这样写
<script language="javascript">
var s;
s += "<html><head></head><body>"
s += "<form name='form1'><select name='select1'><option>"+1+"</option>"
s += "<option>"+2+"</option>"
s += "</select></form></body></html>"
</script>
如果此时在</script>之前的任意时候我再调用此select1应该怎么调用。
希偌 2002-02-23
  • 打赏
  • 举报
回复
document.all.selectname.value
karma 2002-02-23
  • 打赏
  • 举报
回复
<form name="frmtest">
<select name="selist">
...
</select>
</form>

in javascript, you use document.frmtest.selist to reference the list
chinaillboy 2002-02-23
  • 打赏
  • 举报
回复
there is no way to get that
没有办法得到它

because it was just part of the string, you did not even use
因为它仅仅是字符串的一部分,你甚至没有使用 document.write()
document.write() to write it out yet, and the browser
将它输出,因此浏览器还
did not build it into its document object model yet
没有把它建到文档对象模型里

:),见笑

karma 2002-02-23
  • 打赏
  • 举报
回复
there is no way to get that

because it was just part of the string, you did not even use document.write() to write it out yet, and the browser did not build it into its document object model yet

87,996

社区成员

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

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