How to run a function when the page is loaded?

前端 未结 9 1679
小鲜肉
小鲜肉 2020-11-22 11:02

I want to run a function when the page is loaded, but I don’t want to use it in the tag.

I have a script that runs if I initialise it in th

9条回答
  •  清歌不尽
    2020-11-22 11:49

    window.onload = codeAddress; should work - here's a demo, and the full code:

    
    
        
            Test
            
            
        
        
        
        
    


    
    
        
            Test
            
            
        
        
        
        
    

提交回复
热议问题