3 comments. Current rating: (1 votes). Leave comments and/ or rate it.
Answer:Indeed there are these two possiblities as shown in the box below.
The problem with the second solution is that your browser will jump to the top of the page (href=#).
If onclick returns false, the browser never even looks at the href attribute, and so it is not followed. Thus you should add ; return false; to the onclick event handler.
The third example shows how it this looks like.