第九章测试
1.下列方法中,用来替换节点的是( )
A:replaced B:replace() C:change() D:replaceAll()
答案:D
2.在jQuery中,用( )将指定的类添加到匹配元素中。
A:addClass() B:toggleClass() C:removeClass() D:hasClass() 3.在HMTL中用( )实现选择菜单列表结构。
A:option B:ol C:select D:ul 4.下面不属于jQuery文档处理的是( )
A:替换 B:内部和外部插入 C:包裹 D:删除 5.下列替换节点的方法中,跟replaceAll()方法能够实现一样效果的是( )
A:changeTo() B:replace() C:replaced() D:replaceWith() 6.在jQuery中,用( )获取元素的宽度包括内边距和边框。
A:outerWidth() B:width() C:outerWidth(true) D:innerWidth() 7.在jQuery中,用( )将div元素设置圆角。
A:$("div").css(["border-radius":"50%"]) B:$("div").css({"border-radius":"50%"}) C:$("div").css({border-radius:50%}) D:$("div").css("border-radius":"50%") 8.下面选项中,用( )来追加到指定元素的末尾。
A:prepend() B:appendTo() C:inserAfter D:after() 9.下面选项中,能够将id值为conent的元素添加“标题”的是( )
A:$("#content").text("<h1>标题</h1>") B:$("#content").text(<h1>标题</h1>) C:$("#content").html("<h1>标题</h1>") D:$("#content").text() 10.下面代码能够实现,给按钮添加点击事件并获取到文本框的值的是( )
A:$("button").click(function(){$("#text").val())} B:$("button").onclick(function(){$("#text").val())} C:$("button").click(function(){$("#text").html())} D:$("button").click(function(){$("#text").val(value))} 11.在jQuery中,用( )语法实现添加多个类。
A:$(selector).addClass("c1 c2 c3") B:$(selector).addClass([c1,c2,c3]) C:$(selector).addClass({c1,c2,c3}) D:$(selector).addClass("c1,c2,c3") 12.在jQuery中,获取id值为box元素的内容( )
A:val() B:html() C:text() D:value() 13.下面代码中,能够获取表单元素的选中的状态正确的是( )
A:$("input").attr({"checked":checked}) B:$("input").attr(checked) C:$("input").attr("checked") D:$("input").attr() 14.删除表单中的id值为btn的按钮,且保留其点击事件,用( )来实现。
A:remove() B:delete() C:empty() D:detach() 15.在jQuery替换节点的方法中,将p元素替换为span元素,下面的示例代码中正确的是( )
A:$('p').replace('<span>替换喽</span>'); B:$('p').replaceAll('<span>替换喽</span>'); C:$('p').replaceWith(<span>替换喽</span>); D:$('p').replaceWith('<span>替换喽</span>'); 16.在编写页面的时候,如果想要获取指定元素在当前窗口的相对偏移,用()来实现,该方法的返回值有两个属性,分别是( )和()。
A:offsetWidth left top B:offset() width height C:offsetHeight left top D:offset() left top 17.在jQuery中,each()方法中的this关键字代表的是( )
A:当前元素 B:each()方法 C:index D:jQuery对象 18.在jQuery中,用( )获取元素的高度且包括内边距。
A:innerHeight() B:outerHeight() C:innerWidth() D:height() 19.下面代码$(this).parent()理解正确的是( )
A:获取当前元素的父辈元素 B:获取当前元素的子元素 C:获取当前元素的兄弟元素 D:获取当前元素的相邻元素 20.下面设置表单的值的方法中正确的是( )
A:text() B:val(value) C:html() D:value()

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(6) dxwkbang
返回
顶部