• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Miscellaneous Movers and Shak... > Button, Button, Who’s Got the Button...

Button, Button, Who’s Got the Button?

Why use form buttons just for submitting or resetting forms when 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 such as alerts, you can enter the JavaScript directly, like this:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint