题目内容

【单选题】在一个html文档中,注册了三个键盘事件:用浏览器打开该文档后,在键盘上任意按下一个键,事件触发的顺序下面哪一个正确?。

A. onkeydownonkeyuponkeypress
B. onkeyuponkeydowonkeypress
C. onkeypressonkeydownonkeyup
D. onkeypressonkeyuponkeydown

查看答案
更多问题

【单选题】事件委托利用的是下面哪个原理?

A. 事件驱动
B. 事件绑定
C. 事件捕获
D. 事件冒泡

【多选题】下面html页面代码的功能是实现点击一个列表项时该列表项的背景颜色变成红色,划线的空白处可以填的选项有哪些?()Document
  • 第1项
  • 第2项
  • 第3项
  • 第4项

A. selectedLi
B. arguments[0]
C. arguments
D. event.target
E. this

【多选题】下面是通过在JavaScript中设置事件属性的写法来实现点击一个列表项时该列表项的背景颜色变成红色,脚本代码中for循环的循环体部分可以使用的选项有哪些?()Document
  • 第1项
  • 第2项
  • 第3项
  • 第4项

A. lis[i].onclick=function(){this.style.backgroundColor="red";};
B. lis[i].onclick=function(){lis[i].style.backgroundColor="red";};
C. lis[i].onclick=function(e){e.target.style.backgroundColor="red";};
D. lis[i].onclick=function(e){e.currentTarget.style.backgroundColor="red";};
E. lis[i].onclick=function(){event.target.style.backgroundColor="red";};

【多选题】下面html文档中的JS脚本代码是利用事件委托机制来实现点击列表项后该列表项的背景颜色变成红色,包括通过点击添加按钮后新增的列表项:Document代码中if语句的作中划线处的判断条件可以使用下面哪些?

A. e.target.tagName=="LI"
B. e.target.nodeName=='LI'
C. e.target.className=='item'
D. e.target.getAttribute('class')=='item'
E. event.target.tagName="LI"

答案查题题库