MCQ Bank
In a regular expression, what does \d represent?
- A) Any digit (0–9)
- B) A whitespace character
- C) Any letter
- D) A special symbol
In JQuery, innerHeight() method returns:
- A) height of an element excluding padding
- B) height of an element excluding border
- C) height of an element including padding
- D) height of an element including border
The children() method selects:
- A) Direct child elements only
- B) Parent elements
- C) Sibling elements
- D) All elements in DOM
Which part of a variable is hoisted in JavaScript?
- A) Declaration (variable name)
- B) Assignment (value storage)
- C) Initialization (assigning value)
- D) Expression
In DOM tree, an ancestor can be ___________.
- A) Child, grand-child, great grand-child and so on.
- B) All of the given options
- C) Parent, grand parent, great grand-parent and so on.
- D) Siblings
What does points.sort(function(a,b){return a-b}) do?
- A) Sorts the array randomly
- B) Sorts the array alphabetically
- C) Sorts the array in ascending numeric order
- D) Sorts the array in descending order
______________________ is used to Insert content at the beginning of the selected elements.
- A) After()
- B) Prepend()
- C) Before()
- D) Append()
______________________ is used to Insert content at the end of the selected elements.
- A) Prepend()
- B) Before()
- C) After()
- D) Append()
GET request sends data via:
- A) Header only
- B) Cookie
- C) URL
- D) Body
What is the best way to create an object in JavaScript?
- A) new Object()
- B) {} (object literal)
- C) create()
- D) Object()
How can you determine if a variable is an array in JavaScript?
- A) Inspecting the variable's constructor
- B) Using the typeof operator
- C) Checking if the variable's type is "array"
- D) Using the isArray() function
Which of the following is syntax of creating XMLHttpRequest?
- A) new AJAX()
- B) new HTTPRequest()
- C) createRequest()
- D) new XMLHttpRequest()
Which loop evaluates the condition after executing the code block?
- A) for loop
- B) do/while loop
- C) if statement
- D) while loop
The unary + operator is used to:
- A) Convert an object into an array
- B) Convert a number into a string
- C) Convert a string into a number
- D) Convert a boolean into a string
undefined means:
- A) String value
- B) Value not assigned yet
- C) Null value
- D) Number value
What is the function of document ready event?
- A) None of the given options
- B) To prevent an event from performing its default action
- C) To prevent any jQuery code from running after the document has finished loading
- D) To prevent any jQuery code from running before the document is finished loading
Which key is commonly used to open Developer Tools in most browsers?
- A) F10
- B) F12
- C) F5
- D) F1
HTML validation is performed by:
- A) Server only
- B) Browser automatically
- C) JavaScript only
- D) Database
Which of the following is a fast, small, and feature-rich JavaScript library?
- A) SQuery
- B) None of the given options
- C) FQuery
- D) jQuery
Which attribute triggers validation on form submit?
- A) onclick
- B) onsubmit
- C) onload
- D) onchange