I'm currently working on a feature that involves a button displaying a div when clicked. Within this div, there are actions that could result in the page being reloaded. What I'm trying to achieve is having this button automatically clicked if the page reloads. I've attempted the following code:
window.onload = function() {
document.getElementsByClassName(className).click();
}
Unfortunately, this solution doesn't seem to work as intended. As for reloading the page, I use:
location.reload();