This book helps your students learn JavaScript more easily than ever. From the basics to advanced skills, your students will learn the best practices of modern JavaScript. This book is ideal for students without previous programming experience who need detailed explanations, but it also works well for students who already know another language and are ready to move more quickly. Either way, when your students are done with your course, they’ll have the modern JavaScript skills that are in such demand today.
The only prerequisite for this book is a basic understanding of HTML and CSS.
The Canvas course file contains all the objectives, quizzes, assignments, and slides that you need to run an effective course. It only takes a few clicks to import it into the Canvas LMS. Then, you can customize it for your course. Learn more.
Our students always give feedback on their end-of-course evaluations that Murach textbooks are so well organized and easy to follow, with plenty of code examples, figures, and instructions."
To present the JavaScript skills that your students need in a manageable progression, this book is divided into three sections. Each section represents a level of expertise that your students will achieve.
Section 1 gets your students started fast with a seven-chapter course in JavaScript basics. This section works for programming beginners as well as for students with some programming experience because the pace is adjustable. Beginners can read each chapter carefully and do all the exercises. Students with some programming experience can move more quickly and do just the exercises that you assign. Either way, when they finish this section, your students will be developing simple but useful real-world JavaScript apps that add functionality to a web page by scripting the DOM.
Section 2 presents the rest of the essential skills that your students should have. This includes validating data, saving data in the browser, and working with dates, times, and timers. In addition, this section shows your students how to use object-oriented programming to organize their code by defining their own objects and using ES modules.
If you have time in your course, you can use the chapters in this section to raise your student’s JavaScript skills to a higher level of expertise. These chapters show how to:
This book has been carefully designed to be adaptable for any type of JavaScript course. Here’s how our book can work for two common types of of JavaScript courses:
Because section 1 is designed for students with a basic understanding of HTML and CSS but no programming experience, this book can be used for a first course in programming for web developers. Then, after your students complete that section, you can take them as far as time permits by assigning chapters from sections 2 and 3.
If your students have experience with another language, they’ll be able to move quickly through section 1 of our book. Then, you can work your way through the chapters in sections 2 and 3, either in sequence or in any order that makes sense for your course.
To develop JavaScript apps, this book recommends that your student use the following software. All of this software is available for free. And appendixes A (Windows) and B (macOS) provide complete, step-by-step instructions that your students can use to install it on their systems.
This popular code editor is free and provides many excellent features for developing JavaScript apps.
This web browser provides excellent developer tools for debugging JavaScript apps.
This runtime environment makes it possible to run JavaScript on a server instead of running it in a web browser.
Murach's HTML and CSS begins by presenting an eight-chapter crash course that teaches your students HTML and CSS at a professional level, including a chapter on Responsive Web Design. That’s followed by three sections that can be taught in whatever sequence works best for your course.
So, if your students take an HTML and CSS course before they take the JavaScript course, we hope you’ll consider using both of our books for the series. They’re designed to work together seamlessly in a two- or three-course sequence. They both use our unique didactic methods so your students will learn more in less time. And they teach your students the most important HTML, CSS, and JavaScript skills that are actually used on the job.
If you need to teach both JavaScript and jQuery, we hope you’ll consider using Murach's JavaScript and jQuery. This book is similar to Murach’s Modern JavaScript in many ways, but it integrates coverage of jQuery, an influential JavaScript library that has been around since 2006 and is still used extensively in millions of websites.
“I have several books on JavaScript, but the best one is this one. The text, examples, descriptions, and even the layout all bring you, the learner, an ease of use that is missing in other books.”
- Chris Wallace, Denver Visual Studio User Group
"If you are new to web design or an old pro like me, this book is a must-have in my opinion. I love how it starts out with the basics and then moves on to the good stuff. Each chapter is full of examples and sample code showing you how to do the most common techniques that you will face as a web developer/designer.
“I have not seen a better book on the subject. This one will be on my desk for a while!"
- Shawn Jackson, Web Developer, Colorado
From Dr. Dobb’s Must-Have Books for JavaScript: “The aim of the book is to teach jQuery in an intensely hands-on way. It succeeds in this and probably provides the fastest way to learn and master the framework.”
- Andrew Binstock, Editor-in-Chief, Java Magazine
"An essential characteristic of this book, as well as the other Murach books, is that the examples, programs, and applications are all thoroughly tested. This book will work WONDERFULLY to help you build better and more robust websites!"
- Marvin Schneider, Instructor, New York
“I just finished a pretty heavy application project, the first serious work I have done with jQuery and Ajax. Along the way, I had to deal with preloading images, manipulations of the DOM, tabs, plugins, and Dialogs…. I kept this book at my side throughout the entire project, and it was indispensable. The answers were right there at every turn. All the examples made sense to me, and they all worked!”
- Alan Vogt, ETL Consultant, Information Builders, Inc.
“What I like about this and other Murach books is that within minutes of opening the book, you are developing hands-on with the technology in question.”
- Charles Zimmerman, Developer
View the table of contents for this book in a PDF: Table of Contents (PDF)
Click on any chapter title to display or hide its content.
How JavaScript is used for client-side processing
ECMAScript version history
How to work with folders
How to work with files
How to install the Open in Browser extension
How to run an app
How to create and run an app
How to enter and edit code
How to find and fix syntax errors
The Die Roller app
How to use a browser to run an app
How to use your browser to find and fix runtime errors
The HTML
The CSS
The JavaScript
An introduction to coding statements
How to code comments
Three primitive data types
How to declare and initialize variables
How to declare and initialize constants
Rules and recommendations for naming variables and constants
How to code arithmetic expressions
How to use arithmetic expressions in statements
How to use the console to test expressions and statements
How to display data in the console
How to use the typeof operator
How to fix a precision problem
How to use the Math object
How to join strings
How to include special characters in strings
How to use dialogs
How to parse numbers
The Miles to Kilometers app
The Test Scores app
How to use the relational operators
How to use the isNaN() function
How to use the logical operators
How to code an if statement
How to code a nested if statement
The Guess the Number app
How to use a non-Boolean value in a conditional expression
How to use the conditional operator
How to code a switch statement
The Magic Eight Ball app
How to code while and do-while loops
How to code for loops
How to use the break and continue statements
The Future Value app
How to create and use an array
How to add, replace, and delete array elements
How to use a for loop with an array
How to use for-in and for-of loops with an array
The Test Scores app
How to modify or copy an array
How to inspect or transform an array
The Test Scores 2.0 app
How to inspect a string
How to modify a string
How to create an array from a string
How to chain method calls
The Email Check app
The Bio app
How to work with a function declaration
How to work with a function expression
How to work with an arrow function
The Future Value app
How to work with scope
How to work with default parameters
How to work with the rest and spread operators
The Bio app
How to work with events
How to attach events to HTML elements
The Guess the Number app
How to work with the Event object
The Typewriter app
DOM scripting concepts
How to get elements
How to script elements
How to script element attributes
More skills for scripting attributes
How to script the class attribute
The FAQs app
How forms work
How to script text boxes, text areas, and select lists
How to script radio buttons and check boxes
How to use methods and events with forms and controls
The Register app
How to add, replace, and delete nodes
The updated Register app
How to create an image object
How to preload images
The Image Swap app
The Future Value app
Three types of errors
Common JavaScript errors
How to plan the test runs
How to find errors
How to set breakpoints
How to step through code
How to trace code execution
More methods for tracing execution
How to view the HTML and CSS for a web page
How to create Date objects
How to use the methods of a Date object
How to format dates
How to perform calculations on dates
The Countdown app
How to use a one-time timer
How to use an interval timer
The Clock app
The Timer app
The Slide Show app
How to use input controls for data validation
How to use attributes for data validation
An introduction to regular expressions
The Register app
How to validate an element or a form
How to create custom validation
The Register app 2.0
How to use try-catch statements
How to create and throw exceptions
The Future Value app
An introduction to cookies
How cookies compare to web storage
How to work with local storage
How to work with session storage
How to use the nullish coalescing operator
The Future Value app
How to convert an object to JSON and back
How to use Chrome to work with stored items
The Task List app
How to inspect an array
How to sort elements
How to work with each element in an array
How to filter, map, and reduce elements
The Test Scores app
How to destructure an array
How to create and use an array of arrays
How to loop through an array of arrays
How to sort an array of arrays
How to flatten an array of arrays
The Task List app
How to make a shallow copy
How to make a deep copy
How to use an object literal to define an object
How to use a class to define an object
How to work with objects
How to create and use JavaScript libraries
The Invoice app
How to work with private properties and methods
How to work with accessor properties
How to work with inheritance
When to use inheritance
When to use object composition
The Trips app
How to create cascading methods
How to work with static properties and methods
How to nest objects
How to destructure an object
How to work with generator functions
The Task List app
How to export and import module items
How to declare a script as a module
The Slide Show app
How to rename exports and imports
How to export and import classes
How to create a default export
How to work with import maps
The Task List app
The Clock app
How closures work
The module pattern
How Ajax works
Two common data formats for Ajax
The JSON Placeholder API
How to use the Fetch API for GET requests
How to use the Fetch API for POST, PUT, and DELETE requests
How to use the async and await keywords
The Astronomy Picture of the Day app
How to export an asynchronous function
How to use a top-level await
The User Directory app
How to interactively test code
How to run a script
How to pass arguments to a script
How to use ES and CommonJS modules
How to use the built-in file system module with promises
How to create and use your own module
How to install NPM modules
How package.json files work
How to start an Express app for an API
How to set up a route for a GET request
How to set up routes for POST, PUT, and DELETE requests
The Email List API
How the Canvas API works
How to provide for accessibility
How to draw rectangles
How to draw text
The Tic Tac Toe app
How to work with paths
The Drawing app
How to draw circles and arcs
How to draw colors
The Smiley Face app
How to use the requestAnimationFrame() method
The Pong app
How to drag and drop an HTML element
The Movie List app
How to download the files for this book
How to install Chrome
How to install Visual Studio Code
How to install Node.js and the http-server module
How to test an app on a local web server
How to download the files for this book
How to install Chrome
How to install Visual Studio Code
How to install Node.js and the http-server module
How to test an app on a local web server
If you aren’t familiar with the supporting materials that we provide for our books, please visit the About our Courseware page to learn what we provide and how each component can work for you and your students.
If you’re already familiar with our supporting materials from other books, here’s a quick summary of the courseware available for this book.
Appendixes A (Windows) and B (macOS) give your students instructions for downloading these files.
We provide the files for all of these materials in a zip file. After unzipping this file, you can import these materials into any LMS.
We also provide a Canvas course file that contains most of these files. If you’re using the Canvas LMS, you can use this file to import these materials with just a few clicks.
On this page, we’ll be posting answers to the questions that come up most often about this book. So if you have any questions that you haven’t found answered here at our site, please email us. Thanks!
There are no book corrections that we know of at this time. But if you find any, please email us, and we’ll post any corrections that affect the technical accuracy of the book here. Thank you!
This is our site for college instructors. To buy Murach books, please visit our retail site.