Dom
来源:互联网 发布:数据的重要性的名言 编辑:程序博客网 时间:2024/04/30 06:41
dom document object model 文档对象模型
1、事件
body 事件
onload onunload onbeforeunload
常见事件
onclick(单击)、ondblclick(双击)、onkeydown(按键按下)、onkeypress(点击按键)、onkeyup(按键释放)、onmousedown(鼠标按下)、onmousemove(鼠标移动)、onmouseout(鼠标离开元素范围)、onmouseover(鼠标移动到元素范围)、onmouseup(鼠标按键释放
2、动态设置事件 类似于net中注册事件
document.ondbclick = f1; //让document.ondbclick的事件处理函数为f1
3、window对象 window.document.body 当前浏览器窗口
方法
alert()
confirm("确定?")
navigate("http://www.baidu.com");
var timerId = setInterval("alert('hello')",500);
clearInterval(timerId)
setTimeout()
clearTimeout()
showModalDialog("window.htm") 模态窗体
showModelessDialog("window.htm")非模态窗体
属性
window.location.href
window.location.reload() 刷新页面
window.event
altKey
ctrlKey
shiftKey
returnValue 取消后续内容的执行
srcElement 引发事件的事件源
keyCode 引发事件时的键值
button 引发事件时的鼠标键1为左键,2为右键,3为左右键同时
screen 分辨率
width
height
clipboardData 粘贴板
getData("Text")
setData("Text",val)
clearData("Text")
history
back() go(-1)
forward() go(1)
document
方法
write()
writeln()
getElementById()
getElementsByName()
getElementsByTagName()
createElement()
appendChild()
4、获取元素内容
value
innerText
innerHTML
5、动态修改元素样式
this.style.backgroundColor
this.style.fontSize
this.style.marginTop
this.style.display = "none"隐藏 ""显示
this.style.width = "18px"
6、form对象
事件
onsubmit
方法
submit()
- DOM
- DOM
- dom
- dom
- DOM
- dom
- DOM
- DOM
- DOM
- DOM
- DOM
- dom
- dom
- Dom
- dom
- DOM
- DOM
- DOM
- 第五章 微型计算机输入输出接口
- 关于messagebroker/amf的相关问题
- 指针和引用
- poj3748
- ANDROID音频系统散记之二:resample-1(SRC)
- Dom
- ecplise svn 删除默认账户
- LPC1768的USB驱动(三)----LPC1768的USB模块
- doStartTag(),doEndTag()
- ANDROID音频系统散记之三:resample-2 (SRC)
- mac系统清理工具 系统清理工具CleanMyMac 1.10.8简体中文注册版
- 彻底弄清几乎每次必考的sizeof关键字
- 音频采样术语理解
- ucosii_win_6 -- 在ucosii-win-使用openGL实现模拟意见显示屏