How to add onload event to a div element

前端 未结 24 2256
谎友^
谎友^ 2020-11-22 00:26

How do you add an onload event to an element?

Can I use:

for t

24条回答
  •  不思量自难忘°
    2020-11-22 00:59

    No, you can't. The easiest way to make it work would be to put the function call directly after the element

    Example:

    ...
    
    Some content
    ...

    or - even better - just in front of :

    ...
    
    
    

    ...so it doesn't block the following content from loading.

提交回复
热议问题