Javascript

Topic: JS Window

How can you set position of the page (Top and Left) to 0 using Javascript in one line code?

Well, there is an inbuilt function in JavaScript named scroll() which takes 2 arguments x and y.If you want to set top and left to 0 then call this.window.scroll(0,0);

Browse random answers: