Adding interactivity with JavaScript

HTML is a formatting language. Using the embed tags, we are able to "embed" the Chime plug-in into an HTML page. The user can interact with the display properties using the Chime menu, however there are many occassions where a developer would like to trigger events or actions through the HTML interface.
This is where JavaScript helps us. Below is a structure with a Chime JavaScript button. We define an identification name for the structure and when we click on the button we attach both an action and the ID of the structure we are working with.
  Zoom:

This is what was used to add the interactivity when the button was clicked...

<embed src="strucs/squares.mol" name="squares" height=200 width=200 display3d=wireframe bgcolor=white>&nbsp; Zoom:<embed type="application/x-spt" width=15 height=15 button=push target="squares" script=" spacefill 0.5 zoom 130 move 0 0 0 0 30 0 0 0 0.5 30 move 0 0 0 0 -60 -30 0 0 0.5 30 move 0 0 0 0 30 60 0 0 0.5 30 move 0 0 0 0 0 -30 0 0 0.5 30 reset zoom 130 zoom 100 reset select all colour atoms cpk spacefill off wireframe on">