How to Change something on window.onload? [closed]

So I tried window.onload() = function(){ x.style.display = "none"; }
and it did nothing , i am new to coding and couldn’t find an answer. the thing I nee is the x.style.display to work but cant find an awnser.