试题详情
- 单项选择题 You create a Web page that contains the following code. You need to ensure that when the user clicks an item in the list, the text color of the "Welcome!" message will change. Which declaration should you use?()
A、<ul id="color"> <li onclick="changeColor(this.innerText);">Black</li> <li onclick="changeColor(this.innerText);">Red</li> </ul>
B、<ul id="color"> <li onclick="changeColor(this.style.color);">Black</li> <li onclick="changeColor(this.style.color);">Red</li> </ul>
C、<ul id="color"> <li><a onfocus="changeColor(this.innerText);">Red</a></li> <li><a onfocus="changeColor(this.innerText);">Black</a></li> </ul>
D、<ul id="color"> <li><a onfocus="changeColor(this.innerText);">Red</a></li> <li><a onfocus="changeColor(this.innerText);">Black</a></li> </ul>
- A
关注下方微信公众号,在线模考后查看
热门试题