+ 1
How can I assign multiple functions to window.onload?
4 ответов
+ 3
use addEventListener (in this way listeners added will stack automatically) rather than assigning to window.onload ( it will contain whatever was previously assigned to it ):
https://code.sololearn.com/WXEOcx0xzy32/#js
or you can putt all your code into the same onload method:
https://code.sololearn.com/WkhMvMf19Fj4/#js
+ 2
put all the function outside the window.onload function then just call all of them in the window.onload function
+ 1
Thanks Mohamed ELomari
0
Leon lit but how can I assign all of them to window.onload? Should I separate them with commas?