1.对话框
alert():系统弹出框
参数:弹出的内容,string类型
返回值:undefined
prompt():系统对话框
参数:提示用户输入的内容
返回值:
点击取消按钮返回null
点击确定按钮返回string类型的输入的内容
confirm():系统确认框
参数:提示用户操作的内容
返回值:
点击确认按钮返回true
点击取消按钮返回false
2.超时和间歇调用
超时调用
setTimeout(handler,time):超过一定时间调用函数
time:毫秒为单位。代表超过多长时间后调用函数(只调用一次)
取消超时调用:
clearTimeout(id);
id:setTimeout()的返回值
间歇调用
每间隔一个时间就调用一次函数
setInterval(handler,time);
取消间歇调用:
clearInterval(id);
3.样式属性
outerWidth
outerHeight
innerWidth
innerHeight
style.color
style.backgroundColor
offsetLeft:当前元素距离浏览器左侧的距离,number类型
offsetTop:当前元素距离浏览器上方的距离,number类型
clientWidth:内容宽度
clientHeight:内容高度
scrollWidth:有了滚动元素之后的课滚动的最大高度
scrollHeight
offsetWidth:内容+border:边框以内的宽度
offsetHeight