单项选择题
You create a Web page that contains the following div. You have a JavaScript array named imageurls that contains a list of image URLs. You need to write a JavaScript function that will insert images from the URLs into target. Which code segment should you use?()
- A.$(imageurls).each(function(i,url){ $("
B.$(imageurls).each(function(i,url){ $("#target") += $("
C.$.each(imageurls, function(i,url){ $("
D.$.each(imageurls, function(i,url){$("#target").append("
相关考题
-
单项选择题
A Web page includes the HTML shown in the following code segment. You need to write a JavaScript function that will dynamically format in boldface all of the hyperlinks in the ref span.Which code segment should you use?()
A.$("#ref").filter("a[href]").bold();
B.$("ref").filter("a").css("bold");
C.$("a").css({fontWeight:"bold"});
D.$("#ref a[href]").css({fontWeight:"bold"}); -
单项选择题
You create a Web page that contains the following image element. You need to write a JavaScript function that will dynamically change which image is displayed. Which code segment should you use?()
A.function changeImage() {myImage.src = "image2.png"; }
B.function changeImage() { document.getElementById("myImage").src = "image2.png"; }
C.function changeImage() { getElementById("myImage").src = "image2.png"; }
D.function changeImage() { window.getElementById("myImage").src = "image2.png"; } -
单项选择题
You create a Web page that contains drop-down menus that are defined by using div tags in the following code. You need to write a JavaScript function that will enable the drop-down menus to activate when the user positions the mouse over the menu title. Which code segment should you use?()
A.$(".dropdown-menu").hover( function () { $(".menu-items").slideDown(100); },function () { $(".menu-items").slideUp(100); } );
B.$(".dropdown-menu").hover( function () { $(".menu-items", this).slideDown(100); },function (){ $(".menu-items", this).slideUp(100); } );
C.$(".dropdown-menu").hover( function () { $(this)".slideDown(100); }, function () { $(this).slideUp(100); } );
D.$(".dropdown-menu").hover( function () { $("this.menu-title",).slideDown(100); },function () {$("this.menu-title",).slideUp(100); } );
