JavaScript Resources

JavaScript Fundamentals: Understanding Events – Timothy Robards

JavaScript Fundamentals: Master the DOM! (Part 1)Timothy Robards

getElementById()

Instant Action When Dropdown Selection Is Made – Will Bontrager

Summary: Someone makes a selection from a dropdown list and an action occurs, it occurs immediately. What happens can be pretty much anything that you can code with JavaScript — examples are redirecting to another web page, initiating a download of the selected option, and setting a cookie with a hat size selection for a shopping cart.

There are two parts to this instant-action functionality:

  1. The onchange attribute in the HTML select tag. The attribute sends information to the JavaScript whenever a dropdown list selection has changed.
  2. The JavaScript. The JavaScript does whatever action you code it to do, probably something related to the dropdown list option that was selected.

Leave a Comment

Your email address will not be published.

Scroll to Top