MCQ Bank
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
What is responseXML used for?
- A) Rendering HTML only
- B) Handling CSS data
- C) Parsing XML response data
- D) Processing JSON only
What does setting async = true mean in an AJAX request?
- A) The server does not respond
- B) The browser stops execution until response is received
- C) The request is disabled
- D) The request runs in the background without blocking the page
What is the result of typeof NaN?
- A) string
- B) number
- C) undefined
- D) NaN
Which of the following method(s) is/are used for traversing up the DOM tree?
- A) parent()
- B) grandParents()
- C) parental()
- D) parents() and grandParents()
Loop performance improves when you:
- A) Move calculations outside the loop
- B) Use recursion
- C) Increase iterations
- D) Add extra variables
Why should we avoid eval()?
- A) All of the above
- B) It is unnecessary
- C) It has security risks
- D) It is slow
The break statement is commonly used in:
- A) Objects
- B) Functions
- C) Loops and switch statements
- D) Arrays
Client-side validation is performed by:
- A) Browser
- B) Firewall
- C) Database
- D) Server
To traverse sideways in the DOM Tree, ___________ is not a function.
- A) siblings()
- B) nextUntil()
- C) next()
- D) nexts()
What is the purpose of the debugger keyword in JavaScript?
- A) It makes the code run faster
- B) It compiles the code into HTML
- C) It removes all errors automatically
- D) It pauses code execution for debugging purposes
What is the primary use of the splice() method?
- A) Adds and/or removes elements from the array
- B) Only deletes elements from the array
- C) Sorts the elements of the array
- D) Only adds elements to the array
Which condition confirms that an AJAX request was successfully completed?
- A) readyState == 0 and status == 200
- B) readyState == 4 and status == 200
- C) readyState == 1 and status == 500
- D) readyState == 2 and status == 404
What happens if you use a variable before declaring it (with var)?
- A) The program stops immediately
- B) It may return undefined
- C) It gives a syntax error
- D) It always gives a runtime error
In AJAX, which event is used to check the status of a server response?
- A) onreadystatechange
- B) onsubmit
- C) onclick
- D) onload
Why should we avoid global variables?
- A) They run faster
- B) They can be changed from anywhere in the program
- C) They are always required
- D) They increase security
The JQuery code: $("p").hide() will hide _________.
- A) all <p> elements
- B) None of the given options
- C) only last <p> element
- D) only first <p> element