Canonical Inline Method
<a style="float:right;" href="#" onClick="addNewRecord(); return false">New Record</a>
or better:
<a style="float:right;" href="#" onClick="return addNewRecord()">New Record</a>
where addNewRecord returns false at the end of the function
An even better way is
window.onload=function() { document.getElementById("addLink").onclick=addNewRecord; } function addNewRecord() { ... return false; }
a plus
<style> #addLink { float:right } </style>
and
<a href="#" id="addLink">New Record</a>
Since the abuse of HREF over a link going nowhere to get a pointer frowned, you can consider <span> with onclick and the cursor pointer :. More effort is required to make such an element available, for example, for reading from the screen.
source share