replaceNode()
replaceElement()
replaceChild()
replaceWith()
element.appendChild()
element.insertChild()
element.addChild()
element.attachChild()
removeAttr()
deleteAttribute()
removeAttribute()
deleteAttr()
element.getChildren()
element.childNodes
element.getElementsByTagName()
element.getChildNodes()
insertBefore()
insertPrevious()
appendBefore()
addBefore()
document.getElementByTagName()
document.getElementsByTagName()
document.querySelectorAll()
document.tagName()
classList.add()
classList.remove()
classList.toggle()
classList.replace()
innerHTML
innerText
textContent
All of the above
What will the following JavaScript code do?
var element = document.getElementById("myDiv"); element.remove();
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
insertAfter()
appendChild()
prependChild()
outerHTML
value
hasChildNodes()
childNodes
children
hasChildren()
<script src="script.js"></script>
<javascript src="script.js"></javascript>
<link href="script.js" rel="script">
<script href="script.js"></script>
<script> alert('Hello, World!'); </script>
<js> alert('Hello, World!'); </js>
<style> alert('Hello, World!'); </style>
Multiple <script> tags can be used in the same HTML document
The <script> tag can only be placed in the <head> section
The <script> tag can only be used once in an HTML document
The <script> tag must always reference an external file
JavaScript must always be placed inside the <head> tag
JavaScript can be placed either in the <head> or <body> tag
JavaScript can only be placed in external files
JavaScript cannot be placed in the <head> tag
for loop
while loop
do-while loop
None of the above
for (i = 0; i < 5; i++) { // code }
for (i <= 5; i++) { // code }
for i = 1 to 5 { // code }
for (i = 0; i < 5) { // code }
break statement stops the loop, and continue skips the current iteration
continue statement stops the loop, and break skips the current iteration
Both break and continue stop the loop
Both break and continue skip the current iteration
Yes, but only two levels deep
No, nesting loops is not allowed
Yes, we can nest any number of loops
Yes, but only with for loops