I want to display an alert after the button is displayed i.e., after the page is loaded.
<input type='button' id='lognBtn' value='btn' />
<script>
window.addEventListener("load", function(){ alert(20); });
</script>
Using this code, alert is displayed before page load itself. I tried DOMContentLoaded too. Please help.