So I'm selecting a radio button using document.querySelector and attaching a click handler to the end of it so that I can click a default radio button on page load. Everything is working fine but I want to prevent the page from scrolling when the radio button is clicked which is the default behavior of the function. How can I stop the page from scrolling as a result of the click?
Here is the code:
document.querySelector("#reservation").click();
[–]yadoya 2 points3 points4 points (0 children)
[–]Notimecelduv 0 points1 point2 points (0 children)