HTML is only for markups. You can't do interactivity with it. You could use JavaScript, but then anyone serious could just open up the Source Window and look at the password. The only way you can really do this is with ASP or PHP. Check out tutorials at this site:
http://www.w3schools.com/
Oh, by the way, ASP and PHP are server-side scripting, that is to say that the work is done on the server, not the client's computer, so make sure your webhost supports them first. If you are configuring your own computer as a server, if it's Windows it should come with ASP, but you have to install PHP. Check out php.org. As for Macs, I don't think they come with any server-side scripting at all, but I'm not that farmiliar with them. Check a Mac help site or forum.