I have a tag <a href="#"> Previous </a> 1 2 3 4 <a href="#"> Next </a>
and in some conditions I want this tag to be completely disabled.
Code from comments (this is how the link is generated)
JavaScript
x
6
1
if (n_index != n_pages)
2
a = a+'<li><a href="#" onclick="javascript:paginateAjaxPage('+(n_index+1) +','+stype+');">></a></li><li><a href="#" onclick="javascript:paginateAjaxPage('+n_pages+','+stype+');" >>></a></li>';
3
else
4
a = a+'<li><a style="cursor: pointer;" onclick="return false;">></a></li><li><a style="cursor: pointer;" onclick="return false" >>></a></li>';
5
a = a+'</ul></div>';
6
Advertisement
Answer
Try this when you dont want user to redirect on click
JavaScript
1
2
1
<a href="javascript: void(0)">I am a useless link</a>
2