Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-git2.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <input type="text"></input>
  <button>Click me</button>
  <div id="hide-me">Hide Me!</div>
</body>
</html>
 
#hide-me{
  display: none;
  border: 1px solid olive;
  background: yellow;
  height: 100px;
}
 
$(document).ready(function() {
    $('input').keyup(function() {
        $('div').show();
    });
  
    $('input').focusout(function() {
        $(document).click(function(e) {
            var targetId = $(e.target)[0].id;
            if((targetId !== 'hide-me')) {
                $('div').hide();
            }
        });
    });
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers