Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <input type="text" placeholder="focus me, then tab" /><br />
  <textarea>Focus me via click.   Now try via tabbing.</textarea><br />
    <input type="text" placeholder="focus me, then shift+tab" />
</body>
</html>
 
/** Concept Demonstration 
 *  Organize your code better ;D
 **/
$('textarea')
  .click(focusedBy)
  .keyup(checkTab);
function checkTab(event){
  if (event.keyCode === 9) {
    focusedBy(event);
  }
}
function focusedBy (event){
    console.log('You focused me by ' + event.type);
}
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers