I would like to have the page scroll into an element with class xxxx when any element with class yyyy is clicked. I wrote this down but it does not work. Any help? I am sure I am doing something wrong but I don't know what.
var my_event = document.getElementsByClassName('yyyy');
my_event.onclick = function zb_scroll_function() {
const activity = document.getElementsByClassName('xxxx');
activity.scrollIntoView();};
On a site that I have no access over the DOM layout, I want to scroll to another area of the site when a link with a specific class is clicked.