How can you dynamically change the CSS style of an HTML element using JavaScript?
A). Use the style property of the element to modify CSS styles
B). Use the setStyle() method to apply CSS styles to the element
C). Use inline CSS within the HTML element's tag to specify styles
D). Use external CSS files and link them to the HTML document
How can you remove an HTML element from the DOM using JavaScript?
A). element.remove()
B). element.removeChild()
C). element.delete()
D). document.removeElement(element)
Which JavaScript method is commonly used to create a new HTML element dynamically?
A). document.createElement()
B). document.appendElement()
C). document.makeElement()
D). document.createNode()
How can you change the font size of an HTML element using JavaScript?
A). element.style.fontSize = '16px';
B). element.style.font = '16px';
C). element.fontSize = '16px';
D). element.font = '16px';
How can you change the background color of an HTML element using JavaScript?
A). element.style.backgroundColor = 'red';
B). element.background = 'red';
C). element.bgColor = 'red';
D). element.color = 'red';
How can you change the text color of an HTML element using JavaScript?
A). element.style.color = 'blue';
B). element.textColor = 'blue';
C). element.style.textColor = 'blue';
D). element.color = 'blue';
How can you hide an HTML element from the user interface using JavaScript?
A). element.style.display = 'none';
B). element.style.visibility = 'hidden';
C). element.visible = false;
D). element.style.opacity = 0;
Which JavaScript method allows you to change the text content of an HTML element?
A). innerHTML
B). setAttribute
C). textContent
D). createElement
What is the purpose of the classList property in JavaScript?
A). To access and manipulate the CSS classes of an HTML element
B). To access and modify the text content of an HTML element
C). To access and modify the value of an input element
D). To access and modify the URL of an anchor element
What is the purpose of the innerText property in JavaScript?
A). To set or retrieve the text content of an element, including its descendants
B). To set or retrieve the HTML content of an element, including its descendants
C). To set or retrieve the value of an input element
D). To set or retrieve the URL of an anchor element