Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<a href="http://example.com">Обыная ссылка</a>
<div id="Sept" style="display: block">111</div>
<div id="Oct" style="display: none">222</div>
Новости за: <a href="#Sept" onclick="show('Sept')">Сентябрь</a> <a href="#Oct" onclick="show('Oct')">Октябрь</a>
</body>
</html>
 
// noprotect
function show(s){
document.getElementById('Sept').style.display='none';
document.getElementById('Oct').style.display='none';
document.getElementById(s).style.display='block';
return false;
 };
window.onload = function(){
    var links = document.querySelectorAll('a');
  
    for(var i = 0; i < links.length; i++){
      var a = links[i];
      if(a.hash) {
        a.onclick = show(this.hash.slice(1));
      }
      
      else {
      
      a.setAttribute('data-href', a.getAttribute('href'));
      a.setAttribute('href','//:');
      a.onclick = function(){
        location.href = this.getAttribute('data-href');
        return false;
        }
      }
   }
};
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
tilonorrincopro
0viewers