Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Stop browser from jumping to top of page when link is clicked


// Using the # sign may cause the browser to
// jump to the top of the page
// when the link is clicked. To stop that from
// happening, change the link to this:

< a href = "#" onClick = "alert('Ooo, do it again!'):return false;" > Click on me !</ a >