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>
  <button onclick="showMe()">Show the Div</button>
<div id="one" class="first">
  <h1>Some heading <button onclick="hideMe()">Hide me</button></h1>
  <p>Some content</p>
  </div>
  <div class="second">
    Dynamic height and scroll when goes out of viewport length.
        Dynamic height and scroll when goes out of viewport length.
        Dynamic height and scroll when goes out of viewport length.
        Dynamic height and scroll when goes out of viewport length.
        Dynamic height and scroll when goes out of viewport length.
        Dynamic height and scroll when goes out of viewport length.
    Dynamic height and scroll when goes out of viewport length.Dynamic height and scroll when goes out of viewport length.Dynamic height and scroll when goes out of viewport length.Dynamic height and scroll when goes out of viewport length.Dynamic height and scroll when goes out of viewport length.Dynamic height and scroll when goes out of viewport length.Dynamic height and scroll when goes out of viewport length.
    
    
  </div>
</body>
</html>
 
function hideMe () {
  document.getElementById('one').style.display = 'none';
}
function showMe () {
  document.getElementById('one').style.display = 'block';
}
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers