Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style>
  #cmd {
    font-family: courier;
    font-size: 14px;
    background: black;
    color: #21f838;
    padding: 5px;
    overflow: hidden;
      
  }
  
  #cmd span {
    float: left; 
    padding-left: 3px;
    white-space: pre;
  }
  
  #cursor {
    float: left;
    width: 5px;
    height: 14px;
    background: #21f838;
  }
    
  input {
    width: 0;
    height: 0;
    opacity: 0; 
  }
  
</style>
</head>
<body>
  <div id="cmd">
    <span></span>
    
    <div id="cursor"></div>
    
  </div>
  
  <input type="text" />
  
  Click the black row to give it focus.
  
</body>
</html>
 
$(function() {
var cursor;
$('#cmd').click(function() {
   $('input').focus();
  
  cursor = window.setInterval(function() {
  if ($('#cursor').css('visibility') === 'visible') {
    $('#cursor').css({ visibility: 'hidden' });
  } else {
    $('#cursor').css({ visibility: 'visible' });  
  }  
  }, 500);
  
});
$('input').keyup(function() {
  $('#cmd span').text($(this).val());
  
});
  
  $('input').blur(function() {
     clearInterval(cursor);
     $('#cursor').css({ visibility: 'visible' });    
  });
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers