How to add onload event to a div element

前端 未结 24 2134
谎友^
谎友^ 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

    I am learning javascript and jquery and was going through all the answer, i faced same issue when calling javascript function for loading div element. I tried $('').ready(function(){alert('test'}) and it worked for me. I want to know is this good way to perform onload call on div element in the way i did using jquery selector.

    thanks

提交回复
热议问题