In addition to HTML UI elements, a given *.htm file may contain blocks of script code that will be processed by the requesting browser. There are two major reasons why client-side scripting is used:
To validate user input in the browser before posting back to the web server
To interact with the Document Object Model (DOM) of the browser
Regarding the first point, understand that the inherent evil of a web application is the need to make frequent round-trips (termed postbacks) to the server machine to update the HTML to be rendered into the browser. While postbacks are unavoidable, you should always be mindful of ways to minimize travel across the wire. One technique that saves postbacks is to use client-side ...