We are open! Classes are running in-person (socially distanced) and live online. Secure your seat today

JavaScript for Front-End Book

Step-by-Step Training Workbook Add Interactivity to Websites

In this book you’ll go beyond HTML/CSS and learn JavaScript so you can add interactivity such as animated slideshows, lightboxes (image enlargers), show/hide content, validate forms, and more. You’ll start by learning the fundamentals of JavaScript code. You’ll start by learning the fundamentals of JavaScript code, and then get into jQuery. jQuery is an industry standard framework that lets you quickly and easily write powerful JavaScript. You’ll learn how to use some popular jQuery plugins, and gain an understanding of how plugins work, so you can use any plugin! The course workbook can be completed in any code editor. This course workbook can be completed in any code editor. This is advanced level book is for people who have experience building webpages.

Includes Downloadable Class Files (works on Mac & PC)
ISBN: 978-1-941333-19-8

Download Sample Exercise
Setup & Introduction
Downloading the Class Files
HTML vs. XHTML Syntax
  • Differences between HTML & XHTML syntax
Before You Begin
  • Supported browsers
  • Recommended software
Section 1
Setting Up: Do This Before Other Exercises!
  • Setting up your class files
Fundamentals of JavaScript Code
  • JavaScript methods (such as alerts)
  • Variables
  • The importance of quotes
  • Numbers vs. strings
  • Concatenation
Reusing Code with Functions
  • Defining functions
  • Calling functions
  • Defining parameters & passing arguments
Targeting HTML Elements
  • Using Chrome’s DevTools
  • Selecting HTML elements with getElementById()
  • Manipulating selected elements
  • Getting & setting properties
If Statements: Clearing Form Fields
  • Using if statements
  • Adding event handlers
  • Placing JavaScript in an HTML document
Section 2
Simple Accordion with JavaScript
  • Hiding & showing elements with JavaScript
  • Setting up an accordion
Sharing JavaScript Across Pages
  • Externalizing JavaScript
  • Linking to the JavaScript file
Introduction to Arrays & the Math Object
  • Creating an array
  • Editing an array
  • The Math object
  • Picking a random item from an array
Postcard Generator
  • Getting input from the menu
  • Anonymous functions
  • Adding event handlers in JavaScript
Section 3
Introduction to JavaScript Objects & the DOM
  • Intro to objects
  • The global object
  • Accessing & manipulating objects
Dynamically Changing Content with Custom Objects
  • Checking the functionality of the select menu
  • Getting the chosen value
  • Dynamically changing the state name value
  • Dynamically changing the rest of the values
Introduction to For Loops
  • Creating a for loop
  • Using the for loop to set menus
  • Clearing the contents of a menu
Section 4
Introduction to jQuery: Showing & Hiding Content
  • Getting started with jQuery
  • Running code when the document is ready
  • Click events
  • Using jQuery’s slideToggle() method
Product Color Chooser
  • Creating a product color picker
  • Using jQuery’s attr() method
  • Using jQuery’s addClass() method
  • Using jQuery’s removeClass() method
  • Using jQuery’s hover() method
More Advanced jQuery Showing/Hiding
  • Adding an animation to reveal hidden content
  • Targeting the proper div: traversing the document
  • Swapping the button image with jQuery
Section 5
Using jQuery Plugins: Smooth Scroll
  • Linking to the plugin files
  • Initializing the plugin
  • Customizing plugin behavior with options
jQuery Lightbox: A Pop-up Image Viewer
  • Grouping the photos into a gallery
  • Adding captions
  • Removing the counter
  • Customizing the appearance
jQuery Cycle: A Simple Slideshow
  • Initial setup
  • Defining what content gets cycled
  • Adding more cycles & exploring options
  • Reversing the animation
Section 6
jQuery Cycle: Adding Slideshow Controls
  • Preventing a possible “flash of unstyled content”
  • Enabling the slideshow
  • Adding & customizing the controls
jQuery Form Validation
  • Initializing the plugin & setting options
  • Customizing the error messages
  • Changing the location of the error messages
  • Styling the error messages
jQuery Image Carousel
  • Linking to the plugin files
  • Creating the carousel
  • Styling the carousel
  • An easy way to add prev & next buttons
  • Adding custom prev & next buttons
  • Setting how many items are shown
Bonus Material
Tracking Visitors with Cookies
  • Using a JavaScript API for handling cookies
  • Coding cookies
  • Clearing cookies
  • Updating a cookie: incrementing the number of visits
  • Submitting the cookie info with the form
Photo Filter Website: User Friendly Navigation
  • Using data attributes to track a user’s selection
  • Creating variables to store navigation items
  • Styling the selected buttons
  • Toggling the filter buttons
  • Refining the filter buttons
Photo Filter Website: Getting the Photos to Filter
  • Setting up data attributes for photo categories
  • Creating an array to store the filter choices
  • Getting the All button to show all filter values
  • Getting the rest of the buttons to select the other filters
  • Initially hiding the photos
  • Getting the photos to filter
  • Optional bonus: fixing a usability issue
Photo Filter Website: Creating an Exclusive Filter
  • Adding a checkbox to toggle exclusive filtering on/off
  • Separating the inclusive & exclusive filters
  • Writing a conditional to select the appropriate filter
  • Differentiating the exclusive filter
  • Rerunning the filter when the checkbox is toggled
Recreating the Photo Gallery Filter Using jQuery, Part 1
  • Adding variable references: jQuery vs. JavaScript syntax
  • Attaching a click event handler using the on() method
  • Toggling the filter buttons using jQuery
  • The All button vs. the rest of the buttons
Recreating the Photo Gallery Filter Using jQuery, Part 2
  • Populating a standard JavaScript array using jQuery
  • Using JavaScript to skip over the zero index
  • Hiding the photos
  • Testing the checkbox’s functionality
  • Programming the inclusive & exclusive filters
  • Rerunning the filter when the checkbox is toggled
  • Improving the user experience
Reference Material
Websites for Scripts & Plugins
Common JavaScript Terms Defined

How our eBooks Work Buying eBooks for Someone Else

Features of Noble Desktop eBooks
  • Searchable, with live text that you can copy and paste.
  • Printable.
  • eBook graphics are in color (printed books are black and white).
  • Widely compatible: We provide the most common eBook formats (EPUB, MOBI, & PDF) so you can load them onto the device or app you choose; such as Mac, PC, iPhone, iPad, Kindle, Android, and more.
  • Free updates for the edition you buy. When we make major changes to a book (requiring a new edition), an affordable upgrade option will be available.
  • DRM-free: Files are subtly watermarked with your name and email, but we do not restrict the devices or apps you can use to view our eBooks.
  • Lifetime access to downloads from free your Noble Desktop account.
The Best Way to Enjoy Our Books

Our workbooks are meant to be used while you work on your computer. They typically contain step-by-step exercises that walk you through doing tasks on your computer. An ideal setup would be to have the eBook loaded onto a device (like a tablet/smartphone) or on a second computer monitor, so you can read the book as you work on your computer. You can also print the PDF if you prefer.

Which File Format Is Right for You?
  • Ideal for printing.
  • An exact match to the printed book. If the text reflow of an EPUB or MOBI file is confusing please refer to the PDF.
  • PDF is compatible with most devices, but it’s not optimized for small screens. If using a smaller screen you’ll likely want to use the EPUB or MOBI files.
  • The industry standard eBook format which works with all devices, except for the Amazon Kindle. EPUB can be read on Mac, PC, iPhone, iPad, iPod Touch, Nook, Sony Reader, Kobo, Android, and many more.
  • Ideal for smaller screens as the layout reflows to fit the current device (at the type size of your choice).
MOBI (Kindle)
  • Amazon’s format for Kindle devices and Kindle app.
  • Ideal for smaller screens as the layout reflows to fit the current device (at the type size of your choice).
  • Using an iOS Device such as iPhone & iPad? The Kindle app for Apple iOS devices requires a specialized format which we do not support. While our MOBI will work in the Kindle app, it will not render well on iOS devices. We recommend using the EPUB format with Apple’s Books app if reading on an iOS device.
Recommended Reading Apps
iPhone, iPad
  • Books (EPUB)
Windows PC
Can You Share the eBook or Printouts?

Noble Desktop books are intended for use by you, the owner. They are not intended to be loaned or given to others. The files are subtly watermarked with your name and email, but we do not apply any DRM. You can copy your eBooks to any of your own devices without restriction. You can print the PDF files for your own use, but not to give to others. You cannot sell used eBooks. Ownership is solely yours and cannot be transferred to someone else.

Teachers and training centers wishing to print copies for students should email hello@nobledesktop.com for licensing options and pricing.

Buying an eBook for Someone Else
  • When you buy an eBook for yourself, it will be added into your account. It will be watermarked with your information and is intended for use only by you.
  • You can purchase eBooks for someone else, such as a friend or colleague. Schools and training centers can purchase eBooks for their students (be sure to apply for bulk order discounts).
  • When buying eBooks for someone else, you will receive an eBook voucher code. Send that code to the recipient and they can redeem it. An eBook voucher code can be redeemed once, for the specific book you purchase for them.
  • The recipient of the eBook voucher code will need to log into their Noble Desktop account, or create a free account. In their account they will enter the code on their My eBooks page and the eBook will be added immediately into their account.
  • The recipient receives all the same benefits of Noble Desktop eBooks, which includes lifetime access to download their eBook, as well as free updates to that edition. When the next edition is released, an affordable upgrade option will be available to them.

Examples of What You Learn

Why Our Books Are Unique

Our books are packed with step-by-step exercises that walk you through projects. You’ll learn by doing exercises, not reading long explanations. The goal is to give you hands-on practice with the program, getting you started quickly with the things that are most important for real life work.

demonstration of different book formats: print, kindle, & mobile devices

Buy the workbook

Print book shipments are delayed by approximately one week due to coronavirus. There are no delays for ebooks.

We offer bulk order discounts

This book comes free with our JavaScript for Front-End class

Yelp Facebook LinkedIn YouTube Twitter Instagram