网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
$("div").attr("id","box")说法正确的是()。
- A、删除class属性
- B、删除id属性
- C、给标签div添加class="box"的属性
- D、给标签div添加id="box"的属性
参考答案
更多 “$("div").attr("id","box")说法正确的是()。A、删除class属性B、删除id属性C、给标签div添加class="box"的属性D、给标签div添加id="box"的属性” 相关考题
考题
在jQuery中,找到id="intro"的元素中的所有class="head"的元素,下列书写正确的是哪个()
A.$("div#intro.head")B.$("div#intro")C.$("div.intro.head")D.$("intro.head")
考题
AWebservicereturnsalistofsystemusersinthefollowingformat.Youneedtopopulateadrop-downmenuwiththeIDsandnamesoftheusersfromtheWebservice,intheorderprovidedbytheservice.Whichcodesegmentshouldyouuse?()
A.$.ajax({type:GET,url:serviceURL,success:function(xml){$.each($(xml),function(i,item){$().attr(value,id).text(tx).appendTo(#dropdown);});}});B.$.ajax({type:GET,url:serviceURL,success:function(xml){$(xml).find(user).each(function(){varid=$(this).id;vartx=$(this).name.text$().attr(value,id).text(tx).appendTo(#dropdown);});}});C.$.ajax({type:GET,url:serviceURL,success:function(xml){$(xml).find(user).each(function(){varid=$(this).attr(id);vartx=$(this).find(name).text();$().attr(value,id).text(tx).appendTo(#dropdown);});}});D.$.ajax({type:GET,url:serviceURL,success:function(xml){xml.find(user).each(function(node){varid=$(node).attr(id);vartx=$(node).find(name).text();$().attr(value,id).text(tx).appendTo(#dropdown);});}});
考题
YoucreateaWebpagethatcontainsthefollowingcode.Youneedtoprovidethefollowingimplementation.EachtimetheAddFilebuttonisclicked,anewdivelementiscreated.ThenewdivelementisappendedaftertheotherfileuploaddivelementsandbeforetheAddFilespan.Eachnewelementhasauniqueidentifier.Whichcodesegmentshouldyouuse?()A.$(#AddFile).click(function(){varid=File+++lastId;varitem=$(.File:first).clone(true);$(input:file,item).attr({id:id,name:id});item.insertBefore(#AddFile);});B.$(#AddFile).click(function(){varid=File+++lastId;$(.File:first).clone(true).attr({id:id,name:id}).insertBefore(#AddFile);});C.$(#AddFile).click(function(){varid=File+++lastId;});D.$(#AddFile).click(function(){varid=File+++lastId;varitem=$(.File:first).clone(true);$(input:file,item).attr({id:id,name:id});item.insertAfter(input[type=file]);});
考题
下列代码能够正确找到id为test的div元素的代码是?(其中$为jQuery)()A、$(’.test’)B、$(’div#test’)C、$(’div.test’)D、$(’div’)
考题
以下样式写法正确的是()。A、〈div class=’box’〉〈/div〉B、〈div class=’boxleft’〉〈/div〉C、〈div id=’box’〉〈/div〉D、〈div style=’border:1px solid red’〉〈/div〉
考题
通过js给div标签添加class="box"的属性正确的是()。A、div.setAttribute("id","box")B、div.setAttribute("class","box")C、div.getAttribute("class")D、div.class
考题
divclass="box" h1行成于思毁于随 /h1 divclass="box1" h2class="hh2"车到山前必有路 /h2 /div /div以下可以获取到h2标签的是()。A、$("h2")B、$("hh2")C、$(".box1").children("h1")D、$(".box1").siblings()
考题
有如下标签,通过class获取dom对象正确的是()。A、document.getElementsByTagName("div")[0]B、document.getElementById("div")C、document.getElementsByName("div")D、document.getElementsByClassName("box")[0]
考题
获取 divid="box" /div的id值正确的是()。A、div.getAttribute("id")B、div.getC、div.Attribute("id")D、div.attr("id")
考题
新闻,获取元素title的属性值正确的是()。A、$("a").attr("title").valueB、$(“a”).attr(“title”)C、$(“#a”).attr(“title”)D、$(“a”).attr(“title”).val()
考题
divclass="box" /div以下操作可以获取到该标签的dom对象的是()。A、vardiv=document.getElementsByTagName("div")[0]B、vardiv=document.getElementsByTagName("div")C、vardiv=document.getElementsByClassName("box")[0]D、vardiv=document.getElementsByClassName("box")
考题
以下哪句代码可以实现在id为";next";元素前插入一个div元素?()A、$("#next").append("div/div");B、$("#next").before("div/div");C、$("#next").insert("div/div");D、$("#next").prependTo("div/div");
考题
以下对attr()的使用方法书写正确的是()。A、$("div"):attr("name")B、$("div").attr("name"="va")C、$("div").attr("name":"va")D、$("div").attr("name")
考题
下面说法不正确的是()。A、$("input:checked")选取所有被选中的input元素B、$("#form:disabled")选取id为form的表单内的所有不可用元素C、$("#name").is(":visible")是判断id为name的元素的可见性D、$("div").addClass("background","url(img/up.gif)")是设置样式的
考题
给页面中ID为“div1”的元素的所有后代元素添加“click”事件,以下正确的是()。A、$("#div1").on("click")B、$("#div1").next().on("click")C、$("#div1").siblings().on("click")D、$("#div1").find("*").on("click")
考题
从页面的所有div元素中筛选出id名为demo的div元素,写法正确的是()。A、$("div").has("#demo")B、$("div").filter("#demo")C、$("div").eq("#demo")D、$("div").find("#demo")
考题
单选题以下哪句代码可以实现在id为";next";元素前插入一个div元素?()A
$(#next).append(div/div);B
$(#next).before(div/div);C
$(#next).insert(div/div);D
$(#next).prependTo(div/div);
考题
单选题新闻,获取元素title的属性值正确的是()。A
$(a).attr(title).valueB
$(“a”).attr(“title”)C
$(“#a”).attr(“title”)D
$(“a”).attr(“title”).val()
考题
单选题通过js给div标签添加class="box"的属性正确的是()。A
div.setAttribute(id,box)B
div.setAttribute(class,box)C
div.getAttribute(class)D
div.class
考题
单选题从页面的所有div元素中筛选出id名为demo的div元素,写法正确的是()。A
$(div).has(#demo)B
$(div).filter(#demo)C
$(div).eq(#demo)D
$(div).find(#demo)
考题
单选题给页面中ID为“div1”的元素的所有后代元素添加“click”事件,以下正确的是()。A
$(#div1).on(click)B
$(#div1).next().on(click)C
$(#div1).siblings().on(click)D
$(#div1).find(*).on(click)
考题
多选题以下操作可以获取到该标签的dom对象的是()。Avardiv=document.getElementsByTagName(div)[0]Bvardiv=document.getElementsByTagName(div)Cvardiv=document.getElementsByClassName(box)[0]Dvardiv=document.getElementsByClassName(box)
考题
单选题以下对attr()的使用方法书写正确的是()。A
$(div):attr(name)B
$(div).attr(name=va)C
$(div).attr(name:va)D
$(div).attr(name)
考题
单选题$("div").attr("id","box")说法正确的是()。A
删除class属性B
删除id属性C
给标签div添加class=box的属性D
给标签div添加id=box的属性
热门标签
最新试卷