Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <script type="text/javascript">
    function createDivs(n) { 
      for(var i = 1;i<n;i++) {
    var div = document.createElement("div"); 
    var body = document.getElementsByTagName("body")[0];
    var n_text1 = document.createTextNode("Cell " + i);
    var n_text2 = document.createTextNode(i + " Cell ");
        
    div.style.width = "100px";
    div.style.height  = "100px";
    div.style.border = "1px solid red";
    div.style.cssFloat = "left";
    div.style.margin = "1px"
    div.className = i;
    body.appendChild(div);
     
      div.onmouseover = (function(text) {
      return function () {
          this.innerHTML = text;
      }
}(n_text1.textContent));
        div.onmouseout = function() {
        this.parentNode.removeChild(div);
          
        }
      }   
   }
    
    createDivs(29)
    
  </script>
  
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers