Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Homework-DOM</title>
- </head>
- <body>
- 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>
- <script>
- function showText() {
- let text = document.getElementById('text');
- text.style.display = 'inline';
- let moreButton = document.getElementById('more');
- moreButton.style.display = 'none';
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement