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-1.9.1.js"></script>  <style>span {display:none;}</style>  </head><body>  
<p>
  <input id="a" type="text" /> 
  <span>focus fire</span>
</p>
<p>
  <input id="b" type="password" />
  <span>focus fire</span>
</p>
</body></html>
 
$(document).ready(function() {
  $("input").focus(function () {
    $(this).next("span").css('display','inline').fadeOut(1000);
  });
  
  // This works
  $("#a").click(function () {
    $("#b").focus();
  });
  //...evertyhing else breaks
  $("#b").click(function () {
    $("#a").focus();
  });
  //This creates the error, after this...
  $("#b")[0].focus();
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers