jQuery

jQuery

Test your jQuery knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What is jQuery primarily used for?

    • HTML/CSS styling
    • JavaScript library for DOM manipulation
    • Database queries
    • Server-side programming
  2. Which symbol is used to access jQuery?

    • %
    • $
    • #
    • &
  3. How do you select an element with id “main” in jQuery?

    • $("main")
    • $("#main")
    • $(.main)
    • $main
  4. Which method is used to hide an element?

    • hide()
    • displayNone()
    • invisible()
    • none()
  5. What does $(document).ready() ensure?

    • Page is fully loaded including images
    • HTML is loaded and DOM is ready
    • CSS is applied
    • JavaScript is disabled
  6. Which method is used to find descendants of an element?

    • find()
    • child()
    • descend()
    • getChildren()
  7. What does closest() do in jQuery?

    • Finds nearest sibling
    • Finds nearest ancestor matching selector
    • Finds nearest child
    • Finds nearest element by index
  8. Which method is best for event delegation?

    • bind()
    • delegate()
    • on()
    • trigger()
  9. What does preventDefault() do?

    • Stops event bubbling
    • Prevents default browser action
    • Stops script execution
    • Cancels DOM rendering
  10. Which method stops event bubbling?

    • stopPropagation()
    • preventDefault()
    • stopEvent()
    • haltEvent()
  11. Which method is the most customizable AJAX method in jQuery?

    • $.get()
    • $.ajax()
    • $.post()
    • $.load()
  12. What does the dataType option in $.ajax() specify?

    • Request type
    • Response format expected
    • Timeout duration
    • Encoding
  13. Which callback runs when an AJAX request fails?

    • done()
    • fail()
    • always()
    • error()
  14. Which callback runs regardless of AJAX success or failure?

    • done()
    • fail()
    • always()
    • complete()
  15. What is $.Deferred() used for?

    • Event binding
    • DOM manipulation
    • Managing asynchronous operations
    • CSS styling