Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 6 MCQs Javascript DOM

CSE326 — Internet Programming Laboratory 50 questions. Pick an option to check it.

Read the notes

0 of 50 answered 0 right 0 wrong , 50 left

  1. Question 1 of 50

    What does DOM stand for in the context of Web Development?

  2. Question 2 of 50

    How does the DOM represent an HTML document?

  3. Question 3 of 50

    Which object represents the entry point to the DOM?

  4. Question 4 of 50

    Which method is used to find an element by its specific ID?

  5. Question 5 of 50

    What does 'document.getElementsByTagName('p')' return?

  6. Question 6 of 50

    Which method is used to select the first element that matches a specified CSS selector?

  7. Question 7 of 50

    How can you change the text content of a specific HTML element?

  8. Question 8 of 50

    Which property is used to get or set the value of an input field?

  9. Question 9 of 50

    What is the correct syntax to change the background color of an element using JavaScript?

  10. Question 10 of 50

    Which method is used to create a new HTML element?

  11. Question 11 of 50

    How do you append a new child node to an existing node?

  12. Question 12 of 50

    Which method removes a child node from the DOM?

  13. Question 13 of 50

    What property returns the parent node of an element?

  14. Question 14 of 50

    Which event occurs when a user clicks on an HTML element?

  15. Question 15 of 50

    What is the difference between 'innerHTML' and 'innerText'?

  16. Question 16 of 50

    How do you add an event listener to an element?

  17. Question 17 of 50

    Which property allows you to read or change the class of an element as a string?

  18. Question 18 of 50

    Which property allows you to add or remove CSS classes easily using methods like .add() and .remove()?

  19. Question 19 of 50

    What does 'document.write()' do?

  20. Question 20 of 50

    Which attribute is used to access the attribute value of an HTML element?

  21. Question 21 of 50

    How do you set an attribute on an element?

  22. Question 22 of 50

    Which event triggers when a web page has finished loading?

  23. Question 23 of 50

    Which property provides the full URL of the current HTML document?

  24. Question 24 of 50

    What is the return type of 'document.querySelectorAll'?

  25. Question 25 of 50

    How do you prevent the default behavior of an event (like a form submission)?

  26. Question 26 of 50

    Which DOM property is used to hide an element using CSS?

  27. Question 27 of 50

    What is the root element of the document.documentElement property?

  28. Question 28 of 50

    Which event fires when an input field loses focus?

  29. Question 29 of 50

    How can you access the text content of a node and all its descendants?

  30. Question 30 of 50

    What does the 'this' keyword refer to inside an event handler function defined in HTML?

  31. Question 31 of 50

    Which method is used to remove an attribute from an element?

  32. Question 32 of 50

    How do you replace one child node with another?

  33. Question 33 of 50

    Which event is triggered when the user moves the mouse over an element?

  34. Question 34 of 50

    What is 'event bubbling'?

  35. Question 35 of 50

    Which method stops the propagation of an event in the bubbling or capturing phase?

  36. Question 36 of 50

    How do you change the font size of an element to 20px using JavaScript?

  37. Question 37 of 50

    What property holds the title of the document defined in the <title> tag?

  38. Question 38 of 50

    If 'document.getElementById' does not find an element, what does it return?

  39. Question 39 of 50

    Which collection returns all <img> elements in the document?

  40. Question 40 of 50

    What is the purpose of 'document.forms'?

  41. Question 41 of 50

    Which of the following is NOT a valid node type?

  42. Question 42 of 50

    Which method allows you to insert a new node before an existing node?

  43. Question 43 of 50

    To toggle a class 'active' on an element, which syntax is correct?

  44. Question 44 of 50

    What does the 'event.target' property refer to?

  45. Question 45 of 50

    Which event triggers when a user types a key in an input field?

  46. Question 46 of 50

    How do you access the first child node of an element?

  47. Question 47 of 50

    Which method can be used to determine if an element has a specific attribute?

  48. Question 48 of 50

    What is the third argument in 'addEventListener' used for?

  49. Question 49 of 50

    Which DOM object allows access to the browser's history?

  50. Question 50 of 50

    How do you remove an event listener previously added with addEventListener?

That's unit 6

Answer a few questions and your score shows up here.