It is an interpreted programming language with object-oriented capabilities.
Java Script was first known as Live Script, but Netscape changed its name to Java Script, possibly because of the excitement being generated by Java.
It has an API for working with text, arrays, dates, regular expressions, and basic manipulation of the DOM, but does not include any I/O, such as networking, storage, or graphics facilities, relying for these upon the host environment in which it is embedded.
Initially only implemented client-side in web browsers, Java Script engines are now embedded in many other types of host software, including server-side in web servers and databases, and in non-web programs such as word processors and PDF software, and in runtime environments that make Java Script available for writing mobile and desktop applications, including desktop widgets.
The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers.
If the purpose of registration is to confirm that the person exists, and that they have supplied a valid email address, then as part of the registration processe you a should either email them a random password or a confirmation token rather than letting them choose their own password and use it immediately.
The code presented below would then be used for letting the user change their password.
The script should be included in or referenced by an HTML document for the code to be interpreted by the browser.
It means that a web page need not be a static HTML, but can include programs that interact with the user, control the browser, and dynamically create HTML content.