Manipulating DOM elements (changing content, styles, attributes)
Qus. 1 : Which of the following is used to change the content of an HTML element?
- element.innerHTML
- element.value
- element.content
- element.innerText
- element.background = "red";
- element.style.backgroundColor = "red";
- element.style.background = "red";
- element.css.backgroundColor = "red";
- element.addEvent()
- element.addEventListener()
- element.attachEvent()
- element.onEvent()
- replaceNode()
- replaceElement()
- replaceChild()
- replaceWith()
- removeAttr()
- deleteAttribute()
- removeAttribute()
- deleteAttr()
- insertBefore()
- insertPrevious()
- appendBefore()
- addBefore()
- classList.add()
- classList.remove()
- classList.toggle()
- classList.replace()
- innerHTML
- innerText
- textContent
- All of the above
- Remove the element with the ID "myDiv" from the DOM
- Remove all child elements inside the element with the ID "myDiv"
- Hide the element with the ID "myDiv"
- Move the element with the ID "myDiv" to a different location
- insertBefore()
- insertAfter()
- appendChild()
- prependChild()
- hasChildNodes()
- childNodes
- children
- hasChildren()