How can I Change the Contents of an HTML Element

To change an HTML element such as a paragraph with a button click,
first create the paragraph tag
and then you would create a button tag. On this button tag,
you would add the onclick attribute and set it equal to the function which you want to call.



HTML Code

Javascript Code