Friday, April 3, 2009

HTML - Use "return false" to avoid page jump on clicking anchor tag.

Assume that we are having HTML webpage with more content. (i-e the content extends more than height of the browser). Normally, on clicking a hyperlink (i-e anchor tag) having href as "#", top of the web page will be displayed. If we use "return false" as below, we can avoid this jump.(i-e the web page will show the portion having the clicked hyperlink).

<a href="#" onclick="javascript:alert('');return false;" >click here</a>
More Articles...

No comments:

Thanks for visiting our blog

twitterrss facebook linkedin YouTube subscribe

Subscribe via email

Enter your email address: