这个jQuery测验(问题11-20)测试您对这个流行的JavaScript库的了解。 欢迎校正!
涵盖的关键概念:此测验评估您对JQUERY的事件处理,功能执行,元素选择,类操纵,DOM Traversal和代码解释的理解。
>>问题11:您如何确定使用jQuery按下哪个键?
a。 $('#txtValue').keypress(function (event) { $('#txtvalue').alert((event.keyCode)); });
B.$(‘#txtValue’).keypress(function (event) { alert(String.fromCharCode((event.keyCode))); });
C.$(‘#txtValue’).keypress(function (event) { alert(fromCharCode((event.keyCode))); });
D.$(‘#txtValue’).keypress(function (event) { $(‘#txtvalue’).alert((event.which)); });
正确的答案:
API参考: https://www.php.cn/link/2d2c18c1aaeaeaeacc9fcc028ddd14f4c074ce
>给定此代码:如果单击“ lastli”,请执行?>
$('#ul1 li').on('click', function1); $('#ul1').after('<li id="lastLi">Last item</li>');
a。是的
B.否function1
正确的答案:
>问题13:>
返回什么?>
a。 带有ID“ Li”的标签。
B.带有“ li”类的标签。
c.标签是$("ul#myId > li");
的孩子,上课“ myid”。
D.
>
li
ul
正确的答案:li
ul
>>?的结果是什么
a。索引3n 1(n = 0、1、2…)的行获得课程。 B.索引3n(n = 1,2…)的行获得课程。 C.所有行都上课。 D.没有排获得课程。
>正确答案: > a。
B.
C.
D. 正确的答案: 问题16: a。将每个跨度与 正确答案:a(请参阅此操作: >?的结果是什么
C.$('#table1').find('tr').filter(function (index) { return index % 3 == 0 }).addClass('firstRowClass');
a(请参阅此处的操作:$('#source').prependTo('#destination');
>$("#source").add("#destination");
做什么?$("#source").html("#destination");
<li>
中的类“ item”包裹。
B.将每个跨度的“项目”插入<li>
。
C.将“项目”插入每个跨度,并使用“项目”插入。
D.用“项目”替换每个跨度。jQuery.unique([1, 2, 2, 3, 3, 1]);
a。 [1, 2, 3]
D.以上都没有
[3, 2, 1]
[1, 1, 2, 2, 3, 3]
正确答案:
a。显示的11-20行。
B.显示从> 10开始的20行。
C.删除的行10-20行。
D.删除20行,从$('#table1').find('tr').hide().slice(10, 20).show();
>的10开始
正确答案:table1
a(请参阅此操作:table1
问题19:table1
>
<p> </p>
标签标签。
B.所有标签和
标签标签。
C.所有标签。
D.所有
标签。
正确的答案:b(请参阅行动中:
问题20:<p></p>
>哪个语句返回
包含“ jquery”的标签?
以上是jQuery测验问题11-20的详细内容。更多信息请关注PHP中文网其他相关文章!