I find many times the pages use "a" tag and want to make it like a button. it's something like this:
<a href="#" class="button" onclick="...." />
I'm confusing about why not just use "button" tag? like this:
<button onclick="....">button</button>
what is the difference between? I really want to learn it, thanks!
One more situation question:
Three "button-like < a > tag" as below:
Hint:
- Different one call ajax then get different period record
- Need to use onclick="location.replace()" because back to last page smoothly.
Original code:
<a href="url" class="btn" >Today</a>
I have changed to:
<a href="#" onclick="location.replace(url)" class="btn" >Today</a>
Consider about:
<button onclick="location.replace(url)">Today</button>
What will you do in this situation? Is any incorrect to use button tag ?