Way2tutorial Snippet Editor
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>innerHTML - JavaScript Introduction</title> </head> <body> <p id="text">Click to change Text Message....:)</p> <button type="button" onclick="document.getElementById('text').innerHTML = 'Hello World!';">Change Text</button> <br /> <br /> <button type="button" onclick="document.getElementById('set_text').innerHTML = document.getElementById('text').innerHTML;">Get Text</button> <p id="set_text"></p> </body> </html>