Write on input box

Write on input box

Hi,

I´m try to adapt this script: Creating a Keyboard with CSS and jQuery to input information on a input box.

The tutorial works on:
  1.     <textarea id="write" rows="6" cols="60"></textarea> 
But i need to change to a  input box:
  1. <input name="password" id="password" class="inputtext"  maxlength="40" type="password">

On:
  1. $(function(){  
  2.     var $write = $('#write'),  
  3.         shift = false,  
  4.         capslock = false;  
  5.   
  6.     // The rest of the code goes here.  
  7. });

I try to change de line 2 for

  1.   var $write = $('#password'), 
But not work.

Im very new in jQuery and any help is welcome.

Regards,

Carlos