There are a ton of unnecessarily complicated JavaScript examples strewn about the Internet. In an attempt to counter that, here are a few simplified examples of using JavaScript to accomplish common tasks.
Catalog of JavaScript Snippets:
To try out a snippet, click the link for the example listed below the snippet.
Code here is Public Domain Software — free to use as you like.
Show/Hide Toggle
JavaScript can be used to show and hide an object on a web page with each click by the user. This JavaScript snippet finds the display status of the element and flips the status from "none" (hidden) to "block" (visible) or from "block" to "none".