- The code for an Alert Box is:
- You can add an event such as OnClick to trigger the Alert from a text link or a form button or an image.
- Here is the Alert Box code added to links:
Select the text you want to make into a link. Type # in the Properties Link box .
This will stop the browser trying to open a new window.
Deselect the text then select again. This is to make sure that the behavior is not linked to the whole page.
Find where the Behaviors are in your version of Dreamweaver and click the + to add one.
Choose Call JavaScript
Type in the code for an alert as shown:
You do not use quote marks this time as there are quote marks around the function MM_callJS that is called in the code that Dreamweaver generates.
<a href="#" onClick="MM_callJS('alert(\'Your text goes here\') ')">Link</a>
Make an HTML page that has links with events and a form with a range of suitable responses using JavaScript. Try the OnMouseOver event as well as the OnClick