Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <input type="text" id="demo">
- <button type="button" onclick="printText()">
- Click Me!
- </button>
- <h2 id="h2_text">
- </h2>
- <script type="text/javascript">
- function printText() {
- var result = document.getElementById("demo").value;
- document.getElementById("h2_text").innerHTML = result;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement