Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function toggle() {
- const button = document.getElementsByClassName('button')[0];
- button.textContent = button.textContent === 'More' ? 'Less' : 'More';
- const paragraph = document.getElementById('extra');
- paragraph.style.display = paragraph.style.display === 'none' || !paragraph.style.display ? 'block' : 'none';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement