How to stop a HTML page from redirecting using Javascript when the user clicks a link if a condition is false/true? To be specific, the link is something like this:
<a href = "something.html">
<li class ="num" id="day1" onclick = "return checkDate(1)"></li>
<li class ="num" id="day2" onclick = "return checkDate(2)"></li>
<li class ="num" id="day3" onclick = "return checkDate(3)"></li>
</a>
In my javascript file, I'll have something like:
Function checkdate(a){
if(a = 3){ don't redirect }
}
Just I don't know what to put to and all the google results for the problem are confusing. Thanks in advance.