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;
How can you dynamically change the text content of an HTML element based on user input using JavaScript?
A). Use event listeners like addEventListener to detect input changes and update the element's text content
B). Use inline JavaScript in the HTML element's onclick attribute to update the text content
C). Use the onChange event directly in the HTML element's tag to update the text content
D). Use the inputValue property in JavaScript to directly modify the element's text content
What is the purpose of the setAttribute() method in JavaScript?
A). To set or change the value of an attribute on an HTML element
B). To set or change the text content of an HTML element
C). To set or change the source (URL) of an image element
D). To set or change the background color of an HTML element
How can you dynamically change the font family of an HTML element using JavaScript?
A). Use the element.style.fontFamily property to set the desired font family
B). Use the element.fontFamily = 'fontName'; property to directly modify the element's font family
C). Use inline CSS within the HTML element's tag to specify the font family
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)
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';
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()
Which JavaScript method allows you to change the text content of an HTML element?
A). innerHTML
B). setAttribute
C). textContent
D). createElement
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 dynamically change the background color of an HTML element based on user actions using JavaScript?
A). Use event listeners like addEventListener to detect user actions and update the element's background color
B). Use inline JavaScript in the HTML element's onclick attribute to change the background color
C). Use the onHover event directly in the HTML element's tag to change the background color
D). Use the element.background = 'color'; property in JavaScript to directly modify the element's background color