Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<input type="password" id="field" type="password" />
</body>
</html>
 
(function( window, undefined ){
  var $ = window.jQuery;
  var $input = $( "#field" );
  var input = $input[0];
  var mustard = false;
  var $switch;
  
  try {
    input.type = "text";
    if ( "text" === input.type ) {
      mustard = true;
    }
  }
  catch(e){
  }
  if ( true === mustard ) {
    $switch = $( '<a href="#" id="pwcc">toggle</a>');
    $switch.on( 'click', toggle );
    $( 'body' ).append( $switch );
  }
  
  function toggle( event ){
   if ( "text" === input.type ) {
    input.type = 'password';
    }
    else {
      input.type = 'text';
    }
   event.preventDefault();
  }
  
})( window );
Output

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

Dismiss x
public
Bin info
peterwilsonccpro
0viewers