HTMLDOM(二)

作者在 2018-11-19 20:36:25 发布以下内容

1.单选框/复选框/列表框

说明:

A.单选框/复选框在HTML中默认被选定,需

要使用checked="checked"属性;在HTMLDOM编程时

需要使有object.checked = boolean语句。

B.所有表单控件(如单行文本框、密码框等)都存

在disabled="disabled"属性(禁用);在HTMLDOM

编程时使用object.disabled = boolean语句。

二、选取对象的方法(总结)

A.document.getElementById(string id)

B.Element.getElementsByTagName
(string tagName)

返回由标记名称所组成的集合(NodeList)。

C.document.getElementsByName
(string name)

返回具有相同name属性的对象所组成的集合
(主要用于复选框)

四、window对象

setTimeout()
描述:设置一次性定时器
语法:int window.setTimeout(string code,int time)

setInterval()
描述:设置周期性定时器
语法:int window.setInterval(string code,int time)

clearTimeout()

描述:清理由setTimeout()方法设置的定时器
语法:window.clearTimeout(int timeId)

clearInterval()

描述:清理由setInterval()方法设置的定时器

语法:window.clearInterval(int timeId)

open()
描述:打开浏览器窗口
语法:window.open(url)

JavaScript | 阅读 1084 次
文章评论,共0条
游客请输入验证码
最新评论