Can I use body onload and window.onload at the same time? I’ve tried it using this code
<body onload = "alertFirst()">
</body>
<script>
window.onload = alertSec;
</script>
But it didn’t work. I just need someone to confirm it to me. Many thanks
If one or more of the scripts you want to use has the event handler in the BODY HTML tag, you can still move it to into javascript code. See the example below:
Script #1:
Script #2:
Result:
I think it may can help you.