In jQuery, which method changes the CSS of an element?
Anonymous Quiz
10%
.property()
62%
.css()
4%
.attr()
24%
.style()
What does this code return? $(#myInput).val();
Anonymous Quiz
23%
The id of the input
0%
Nothing
54%
The user-entered value
23%
The HTML inside the element
Which jQuery method is used to hide elements?
Anonymous Quiz
2%
.remove()
10%
.delete()
87%
.hide()
2%
.display()
How do you declare a JavaScript variable?
Anonymous Quiz
13%
var x;
7%
int x;
6%
let x = 0;
74%
Both A and C
What is the correct way to write a JS comment?
Anonymous Quiz
8%
<!-- comment -->
4%
// comment
6%
/* comment */
83%
Both B and C
How do you write a multi-line comment?
Anonymous Quiz
79%
/* comment */
12%
<!-- comment -->
8%
// comment
2%
None of the above
How do you declare an array?
Anonymous Quiz
15%
array arr = [1,2,3];
12%
var arr = {1,2,3};
6%
var arr = (1,2,3);
67%
var arr = [1,2,3];
Which of these is correct to add a property to an object?
Anonymous Quiz
16%
obj.name = "John";
6%
obj->name = "John";
12%
obj[name] = "John";
65%
Both A and C
How do you create an object in JS?
Anonymous Quiz
19%
var obj = {};
8%
var obj = []
19%
var obj = new Object();
55%
Both A and C
Which statement correctly adds an element at index 2 of an array?
Anonymous Quiz
12%
arr.insert(2,5)
6%
arr.push(2,5)
73%
arr[2] = 5;
10%
arr.add(2,5)
What is the output of:
console.log(0.1 + 0.2 == 0.3);
console.log(0.1 + 0.2 == 0.3);
Anonymous Quiz
48%
true
40%
false
8%
Error
4%
undefined
What is the output of console.log(null == undefined)?
Anonymous Quiz
58%
true
27%
false
13%
Error
2%
undefined
How do you change the style of an element with ID "demo"?
Anonymous Quiz
65%
document.getElementById("demo").style.color = "red";
18%
document.getElement("demo").color = "red";
8%
document.querySelector("#demo").color = "red";
8%
document.style("demo").color = "red";
Which of the following is jQuery syntax to hide an element with ID "demo"?
Anonymous Quiz
12%
hide("#demo");
25%
$("#demo").style.display = "none";
29%
document.getElementById("demo").hide();
35%
$("#demo").hide();
How do you set the text of an element in jQuery?
Anonymous Quiz
39%
$("#demo").text("Hello")
26%
$("#demo").innerHTML = "Hello"
24%
document.getElementById("demo").text = "Hello"
11%
$("#demo").value = "Hello"