I have five links, and initially only the first link is enabled. When this first link is clicked, I want it to auto disable and enable the next, that is, the second link, and when the second is clicked, that auto disable and enable the next, and so on.
However, the links that have already been clicked want to remain disabled until you reach the last link. Here is a beginning of what I need:
window.onclick = function(){
document.getElementById('link').onclick = function(){return false};
}
function desabilitar_link(){
document.getElementById('link').innerHTML = "Link desabilitado";
document.getElementById('link').style.color = "grey";
}
<div>
<ul>
<li><a href="http://www.google.com.br/" target='_blank' id="link" onmouseup="desabilitar_link()"> Link habilitado </a></li>
<li><a href="http://www.google.com.br/" target='_blank' id="link2" onmouseup="desabilitar_link()"> Link habilitado </a></li>
<li><a href="http://www.google.com.br/" target='_blank' id="link3" onmouseup="desabilitar_link()"> Link habilitado </a></li>
<li><a href="http://www.google.com.br/" target='_blank' id="link4" onmouseup="desabilitar_link()"> Link habilitado </a></li>
<li><a href="http://www.google.com.br/" target='_blank' id="link5" onmouseup="desabilitar_link()"> Link habilitado </a></li>
</ul>
<div>