MCQ Bank
What is the purpose of the pop() method in JavaScript arrays?
- A) Adds an element at the beginning of the array
- B) Sorts the elements of the array
- C) Removes the last element from the array
- D) Removes the first element from the array
Which comparison operator is used internally by the switch statement?
- A) <
- B) ===
- C) !=
- D) ==
How do you access the first element of an array cars in JavaScript?
- A) cars(0)
- B) cars.0
- C) cars{0}
- D) cars[0]
Which of the following feature is not part of the jQuery library?
- A) Effects and animations
- B) CSS manipulation
- C) None of the given options
- D) HTML/DOM manipulation
Which of the following is not a loop in JavaScript?
- A) for
- B) while
- C) for/in
- D) do in
Which keyword tests multiple conditions?
- A) switch
- B) break
- C) else if
- D) if
Which of the following function is not for traversing up the DOM tree?
- A) grandParents()
- B) parentsUntil()
- C) parent()
- D) parents()
In JQuery, outerWidth() method returns:
- A) width of an element including padding
- B) width of an element including border and padding
- C) width of an element excluding padding
- D) width of an element excluding border and padding
What term is used to describe arrays with named indexes in programming languages?
- A) Associative arrays
- B) Linear array
- C) Ordinal arrays
- D) Sequential arrays
onreadystatechange triggers when:
- A) State changes
- B) Form submits
- C) User clicks
- D) Page loads
What is the function of the prepend() method?
- A) Adds content after elements
- B) Adds content at the end
- C) Adds content at the beginning of elements
- D) Deletes content
What does parents() method return?
- A) Only child elements
- B) All ancestor elements up to the root element
- C) Only the direct parent
- D) Only sibling elements
What does the text() method return?
- A) Attribute values
- B) CSS styles
- C) Only the text content of elements
- D) HTML code
What does the removeClass() method do in jQuery?
- A) Switches between adding and removing classes automatically
- B) Removes one or more specified classes from selected elements
- C) Applies animation effects to elements
- D) Adds one or more classes to selected elements
Queue functionality means:
- A) No order
- B) All animations run together
- C) Animation stops
- D) Animations run one by one
What must be passed to an event method to define its action?
- A) String
- B) Number
- C) Boolean
- D) Function
XML files are:
- A) Binary files
- B) Video files
- C) Encrypted files only
- D) Text files that are readable and editable
What does parentsUntil("div") do?
- A) Returns parent elements up to (but not including) the <div> element
- B) Returns sibling elements
- C) Returns all child elements
- D) Returns all parent elements
Which statement about XML element names is correct?
- A) XML element names are case-sensitive
- B) XML element names can contain spaces
- C) XML is case-insensitive
- D) XML element names can start with numbers
What does traversing mean in jQuery?
- A) Adding new elements to the DOM
- B) Changing the style of elements
- C) Moving through and finding elements in the DOM tree
- D) Deleting elements from the page