Skip to content

Latest commit

 

History

History
executable file
·
23 lines (19 loc) · 905 Bytes

readme.md

File metadata and controls

executable file
·
23 lines (19 loc) · 905 Bytes

Introduction

jQuery plugin to swap password field with a text field. The text field on focus will hide and the focus is transfered to the now visible password field. The password field will be swapped back to the text field if left empty.

Example:

<!DOCTYPE HTML>
<html lang="en-US">
<head>
  <meta charset="UTF-8">
  <title>jquery.passwordTextSwap</title>
</head>
<body>
  <form action=""><input type="password" id="password" /><input type="submit" /></form>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  <script type="text/javascript" src="jquery.passwordTextSwap.js"></script>
  <script type="text/javascript">
    jQuery('#password').passwordTextSwap().prev('input:text').val('I am replaced');
  </script>
</body>
</html>

see also