I have two hyperlinks on my page: previous
and next
which navigate to the previous and next pages respectively. I want to disable previous
when I am at the first page and disable next
when I am on the last page.
To try this out I used the following code (showPage
is hardcoded here).
$("#prevUp").click(function (event)
{
event.preventDefault();
var showPage=0;
if(showPage<=1)
{
$("a").removeAttr('href');
}
});
However this is not working. Would you please tell me how I can do this (I have already looked at previous solutions on this problem but could not find one that works for me).
EDIT:
look at http://jsfiddle.net/bhXbh/38/ I tried several solutions here but none are working.