关于JavaScript动态菜单代码的问题
我将代码快照上传到 Flickr.com。
这是html部分: http://www.flickr.com/photos/59919989@N08/5470586866/
这是 JavaScript 部分: http://www.flickr.com/photos/59919989@N08/5470587034/
谁能告诉我圆圈部分的含义是什么?它有什么作用? 非常感谢。
I upload the snaps of the codes to Flickr.com.
Here is the html part:
http://www.flickr.com/photos/59919989@N08/5470586866/
Here is the JavaScript part:
http://www.flickr.com/photos/59919989@N08/5470587034/
Could someone tell me what is the meaning of the circled part? What does it do?
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它获取 id 名为“months”的元素,并在 html 中显示它是 select 标签。然后它使用 selectedIndex 默认设置所选项目。 0 表示选项列表中的第一项,
下次也是“月份”,请将您的代码放入 http://jsfiddle.net< /a>
it gets the element with the id named "months" and in your html it shows that it is the select tag. it then sets the selected item by default using selectedIndex. 0 means the first item in your options list which is "Month"
also next time, please put your code in http://jsfiddle.net
鉴于这是直接来自 JavaScript 和 JavaScript 的。 Ajax for the Web:视觉快速入门指南,第 7 版1,您在第 164-166 页的(逐行)解释中特别遇到什么问题?
1 顺便说一句,由我共同编写。
Given that this is straight out of JavaScript & Ajax for the Web: Visual QuickStart Guide, 7th edition1, what in particular are you having trouble with in the (line-by-line) explanation on pages 164-166?
1 Co-written by me, btw.