Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- function displayText(){
- const alertMsg = document.getElementById("text").value;
- alert("Entered text is: "+alertMsg);
- }
- function clearText(){
- document.getElementById("text").value = "";
- }
- </script>
- </head>
- <body>
- <h1> Buttons and TextArea Controls </h1>
- <textarea id="text" rows="4" cols="58" placeholder="Type here something....."></textarea><br>
- <button onclick="displayText()">Submit</button>
- <button onclick="clearText()">Clear</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement