Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>ShowMore</title>
- </head>
- <body>
- <p>
- Welcome to the "Show More Text Example".
- <a href="#" id="more" onclick= "showText()">Read more …</a>
- <span id="text" style= "display:none">Welcome to JavaScript and DOM.</span>
- </p>
- <script>
- function showText() {
- document.getElementById("text").style.display = "inline";
- document.getElementsById("more").style.display = "none";
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment