Auto scroll when Text appears
I'm trying to put multiple buttons next to each-other. When I press on a button, the text appears and auto-scroll happens. This works. But when I want more buttons, then it doesn't work the way I want it to work. Either it shows an error and neither buttons work, or the second button shows the same text as the 1st button. This is the 1st button which I'm trying to copy. <button id="scroll" class="button-friends-clickon" type='button' onclick="toggleText()"><a href="#scroll" style="color:yellow">Demo</a></button> <p id='friends-filia' style='display:none'>text</p> function toggleText() { var text = document.getElementById("friends-filia"); if (text.style.display === "none") { text.style.display = "block"; } else { text.style.display = "none"; } } For the second Button, I'm using the same code but with different ID's and text. Anyone know what to do? Or maybe another code would solve this? Thank you for any help!