This is the code I am using:
<script>
document.getElementById("test").click();
</script>
When I try to trigger the click();
function on page load, it doesn't work. However, when I execute it in the console on Firefox, it works fine. Can someone explain why this discrepancy occurs and provide a solution?
Update: I have attempted the following code as well:
<script>
$(document).ready(function() {
$('#test').trigger('click');
});
</script>
Unfortunately, this also did not resolve the issue...