Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Adobe Dreamweaver

This chapter is from the book

BUTTON, BUTTON, WHO'S GOT THE BUTTON?

Form buttons aren't just for submitting or resetting forms—they can be pressed into a multitude of services. If you need an instantly recognizable button to trigger any function, the form button is ideal; you don't even need to put it within a <form> tag. The easiest way to assign a function directly to a button is to use the Quick Tag Editor. Select the button and press Ctrl+T (Command+T) to display the <input> tag. Tab to the end of the tag and enter onClick="doMyFunction()" where doMyFunction() is the name of...well, your custom JavaScript function. For simple JavaScript commands like alerts, you can enter the JavaScript directly, like this:

Figure7.16Figure 7.16

  • + Share This
  • 🔖 Save To Your Account