Thursday, June 20, 2024

Dynamically Create an H1 tag - Javascript

Question

How can you use Javascript to accomplish the following task:
When a user clicks "Hello" button, how do you dynamically create an <h1> element and add it to a specific '<div>' element with the 'id' 'container' in the HTML document?


Answer:

No comments:

Post a Comment

Change H1 text using buttons dynamically Javascript Sourcecode

Javascript Task How can i make it so that when a user clicks a button, the text from that button is shown...