MCQ Bank
What happens after using $.noConflict()?
- A) CSS stops working
- B) $ becomes available for other libraries
- C) jQuery stops working
- D) DOM is removed
What does $(document).ready() do?
- A) Loads CSS
- B) Hides elements
- C) Executes code after document loads
- D) Creates events
Which of the following is/are example(s) of event?
- A) selecting a radio button
- B) clicking on an element
- C) moving a mouse over an element
- D) All of the given options
Which jQuery code correctly sets both width and height to 500 pixels?
- A) $("#div1").size(500)
- B) $("#div1").resize(500)
- C) $("#div1").width(500).height(500);
- D) $("#div1").setSize(500,500)
Math.random() returns value between:
- A) -1 and 1
- B) 0 and 1
- C) 10 and 100
- D) 1 and 10
XML is used as a format for document storage and processing, ____________.
- A) both online and offline
- B) online
- C) None of the given options
- D) offline
What is the main advantage of AJAX?
- A) Loads data without refreshing the page
- B) Changes CSS styles
- C) Creates new HTML pages
- D) Reloads the full page
XML is commonly used to:
- A) Replace JavaScript
- B) Separate data from presentation
- C) Design hardware
- D) Compress images
Which parameter is required in load() method?
- A) status
- B) URL
- C) data
- D) callback
fadeToggle() does what?
- A) Stops animation
- B) Only fades out
- C) Toggles fade in/out
- D) Only fades in
Which of the following is a correct example of jQuery chaining?
- A) slideUp, slideDown
- B) css + slideUp
- C) css().slideUp().slideDown()
- D) css(); slideUp();
Where can $ still be used after noConflict()?
- A) Only in CSS
- B) Inside a function where it is passed as a parameter
- C) Nowhere
- D) Anywhere in code
A while loop executes:
- A) A fixed number of times
- B) Infinite number of times
- C) Only once
- D) As long as the condition remains true
How can we access a form using JavaScript?
- A) window.form()
- B) document.getElementByClass()
- C) document.forms["formName"]
- D) getForm()
undefined means:
- A) Value not assigned yet
- B) Null value
- C) String value
- D) Number value
Loop performance improves when you:
- A) Increase iterations
- B) Use recursion
- C) Move calculations outside the loop
- D) Add extra variables
What happens when a break statement is executed?
- A) The loop terminates immediately and control exits the loop
- B) Only one iteration is skipped
- C) The loop restarts
- D) The loop continues execution
Default parameters help to:
- A) Remove function
- B) Stop execution
- C) Prevent undefined values in functions
- D) Create loops
The unary + operator is used to:
- A) Convert a string into a number
- B) Convert a boolean into a string
- C) Convert an object into an array
- D) Convert a number into a string
AJAX is about:
- A) Both Sending and receiving data from server by reloading the whole page
- B) Receiving data from server without reloading the whole page
- C) Sending data to server without reloading the whole page
- D) Both sending and receiving data from server without reloading the whole page