Skip to content

Latest commit

 

History

History
74 lines (65 loc) · 3.88 KB

n2ba.md

File metadata and controls

74 lines (65 loc) · 3.88 KB

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors Visitors

Don't forget to hit the ⭐ if you like this repo.

JavaScript: DOM

Set B

Here are the answers to the questions:

  1. a) Document Object Model
  2. c) document.getElementById()
  3. c) The title of the current web page
  4. d) element.textContent
  5. c) element.classList.add()
  6. c) The tag name of the body element
  7. a) document.createElement()
  8. c) To retrieve the value of an attribute from an HTML element
  9. c) The width of the browser window
  10. b) element.addEventListener()
  11. a) To manipulate the CSS properties of an element
  12. a) The number of links in the current web page
  13. c) document.getElementsByClassName()
  14. a) The number of forms in the current web page
  15. a) element.remove()
  16. a) To access the parent element of an HTML element
  17. a) The number of images in the current web page
  18. b) inputElement.value
  19. a) To append an HTML element to another HTML element
  20. a) The tag name of the head element
  21. c) imageElement.setAttribute('src', 'new-source.jpg')
  22. b) To select all elements that match a CSS selector
  23. a) The tag name of the html element
  24. b) element.classList.contains('className')
  25. c) To insert HTML content into an element
  26. a) The character set of the current web page
  27. a) document.createTextNode()
  28. a) To retrieve the width of an HTML element
  29. a) The name of the document type
  30. c) element.display = 'none'
  31. a) To access the next sibling element of an HTML element
  32. c) The width of the browser window
  33. b) element.setAttribute('attribute', 'newValue')
  34. a) To access the list of CSS classes of an HTML element
  35. a) The source URL of the current script file
  36. a) element.hasAttribute('attribute')
  37. a) To access the first child element of an HTML element
  38. a) The date and time when the current web page was last modified
  39. a) element.style.backgroundColor = 'color'
  40. a) To access the previous sibling element of an HTML element
  41. a) The number of embed elements in the DOM
  42. b) selectElement.value
  43. a) To remove an HTML element from its parent element
  44. a) The tag name of the currently focused element
  45. a) element.style.display === 'none'
  46. a) To scroll an HTML element into view
  47. a) The number of script elements in the DOM
  48. d) element.parentElement
  49. a) To retrieve the height of an HTML element
  50. a) true if the current web page has focus, false otherwise

Contribution 🛠️

Please create an Issue for any improvements, suggestions or errors in the content.

You can also contact me using Linkedin for any other queries or feedback.

Visitors