Introduction to JavaScript and the Web
Jeremy McPeak, Paul Wilton · 2015
This chapter explains what JavaScript is, where it came from, how it works, and what sorts of useful things you can do with it. JavaScript is primarily used to interact with users. JavaScript was originally created for validating form input. In fact, advanced JavaScript-driven applications can be created that rival the speed and functionality of conventional desktop applications. Inserting JavaScript into a web page is much like inserting any other HTML content. Linking to an external file is common when incorporating well-known JavaScript libraries into a web page. The biggest advantage of external files is code reuse. The chapter presents a simple example that changes the background color of the web page. Unlike many programming languages, JavaScript requires just a text editor to start creating code. Something like Windows Notepad is fine for getting started, though more extensive tools will prove valuable once you get more experience.