<html> <head> </head> <body> <input type="password" id="x" /> <script type="text/javascript"> document.getElementById('x').value = 'tEsT'; alert(document.getElementById('x').value); </script> </body> </html>