Created
February 23, 2021 13:37
-
-
Save nextab/a33bb5407bf30c51ea824df20fbb7744 to your computer and use it in GitHub Desktop.
Adds an event listener to a button (#reply-title) and toggles a class for a comment form (#commentform)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let replybutton = document.getElementById('reply-title'); | |
let replyform = document.getElementById('commentform'); | |
replybutton.addEventListener('click', function() { | |
replyform.classList.toggle('open'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment