使用javascript禁用按钮

使用javascript禁用按钮,javascript,jquery,Javascript,Jquery,单击“上一步”按钮即可加载。我想在没有更多文章时禁用此按钮。我希望按钮消失 function getPrev(item, article) { for (var i = 0, len = article.length; i < len; i++) { if (article[i].id === item) { return (i - 1 >= 0) ? article[i - 1] : null; } } 函数getPrev(项目、文章){ for(v

单击“上一步”按钮即可加载。我想在没有更多文章时禁用此按钮。我希望按钮消失

function getPrev(item, article) {
  for (var i = 0, len = article.length; i < len; i++) {
  if (article[i].id === item) {
    return (i - 1 >= 0) ? article[i - 1] : null;
  }     
}
函数getPrev(项目、文章){
for(var i=0,len=article.length;i=0)?条[i-1]:空;
}     
}

谢谢

如果要隐藏按钮,请使用

$("#buttonid").hide();
如果你想禁用它

$("#buttonid").prop("disabled",true);

如果要隐藏按钮,请使用

$("#buttonid").hide();
如果你想禁用它

$("#buttonid").prop("disabled",true);

如果要隐藏按钮,请使用

$("#buttonid").hide();
如果你想禁用它

$("#buttonid").prop("disabled",true);

如果要隐藏按钮,请使用

$("#buttonid").hide();
如果你想禁用它

$("#buttonid").prop("disabled",true);
你能做的就是-

document.getElemenyById('buttonid').style.display = 'none';
你能做的就是-

document.getElemenyById('buttonid').style.display = 'none';
你能做的就是-

document.getElemenyById('buttonid').style.display = 'none';
你能做的就是-

document.getElemenyById('buttonid').style.display = 'none';

如果有文章,请记住将样式设置为“block”。如果有文章,请记住将样式设置为“block”。如果有文章,请记住将样式设置为“block”。如果有文章,请记住将样式设置为“block”