MCQ Bank
What does the width() method return in jQuery?
- A) Only margin value
- B) Width including margin
- C) Width including padding
- D) Content width only (excluding padding, border, and margin)
What does it mean that XML is “extensible”?
- A) XML cannot be modified
- B) New elements can be added without affecting existing structure
- C) XML has fixed predefined tags
- D) XML only works with HTML
What does the append() method do?
- A) Removes content
- B) Inserts content at the end of selected elements
- C) Replaces content
- D) Inserts content at the beginning
How are methods executed in a jQuery chain?
- A) In random order
- B) One after another in sequence
- C) In reverse order
- D) All at the same time
Which of the following is NOT a DOM relationship?
- A) Attribute
- B) Child
- C) Parent
- D) Sibling
In $.post(), which parameter is optional?
- A) Both Data and Callback
- B) Callback
- C) Data
- D) URL
The val() method is mainly used for:
- A) Working with images
- B) Adding animations
- C) Styling elements
- D) Getting or setting values of form fields
A callback function executes:
- A) Randomly
- B) Before effect
- C) During effect
- D) After effect completes
Which of the following is the default character encoding for XML documents?
- A) None of the given options
- B) UTF-8
- C) UTF-16
- D) UTF-32
Math.floor() does:
- A) Divide number
- B) Round up
- C) Random number
- D) Round down
What does “self-describing syntax” in XML mean?
- A) XML needs external explanation
- B) XML cannot be read by humans
- C) XML explains itself using tags
- D) XML is only for programming
Which method selects siblings between elements in a range?
- A) nextUntil()
- B) next()
- C) prev()
- D) siblings()
In hide(speed, callback), callback runs:
- A) After hide completes
- B) During hide
- C) Never
- D) Before hide
What will the following code return? $("p").css("background-color");
- A) Background color of all <p> elements
- B) Background color of last <p> element
- C) Background color of first matched <p> element
- D) Returns the CSS property name only
Why is XML useful when data changes frequently?
- A) Because data can be stored separately from HTML
- B) Because HTML must be rewritten
- C) Because it only works offline
- D) Because XML automatically deletes data
The hover() method combines:
- A) click + dblclick
- B) keydown + keyup
- C) mouseenter + mouseleave
- D) focus + blur
What is the top element of an XML tree called?
- A) Child element
- B) Root element
- C) Leaf element
- D) Attribute
How can multiple classes be added using addClass()?
- A) addClass("class1 class2")
- B) addClass(["class1", "class2"])
- C) addClass("class1+class2")
- D) addClass("class1, class2")
What is the correct syntax of $.get()?
- A) $.get(callback)
- B) $.get()
- C) $.get(URL, callback)
- D) $.get(data, URL)
Which syntax is used to assign a click event in jQuery?
- A) $("p").click()
- B) $("p").trigger(click)
- C) $("p").onClick()
- D) $("p").event(click)