a href=#

Instead of using href="#", it is better to use href="javascript:void(0);" to make page not go up when we click on link
Also, prefer using type="button" to prevent a button from submitting a form


<a href="#" onclick="func()" >Testing1</a>

<a href="javascript:void(0);" onclick="func()" >Testing1</a>

button inside <form> to prevent submitting the form
<button type="button">Not a submit</button>

Views 2235 Downloads 841


ANmarAmdeen
612
Components HTML+CSS
Revisions

v1.0