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 557 Downloads 198

'button', 'href', 'link', 'ancher', 'hyperlink', 'submit', 'form', 'javascript:void(0);', 'javascript', 'void'

ANmarAmdeen
326
Components HTML+CSS
Revisions

v1.0