Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i have a web form designed in asp.net. i want a javascript to shift the focus of the page to top on a button click.

plz help me on that.


sumit
Posted
Comments
Niklas L 11-Aug-10 8:15am    
What do you mean by shifting focus to top? Do you want a control to get focus, or are you trying to scroll to the top of the page?
samgreat99 11-Aug-10 8:23am    
i want to scroll to the top of the page. i dont want to focus on any control.

1 solution

window.scrollTo(x, y); using x=0 and y=0, might be a solution depending on what you want to achieve.

For an example look here[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900