|
To write scripts using buttons, we will first need to know how to place a button on the page. To do this, you will need to use the <form> and <input> tags to set up a button tag or you can just use the <button> tag. Here's an example that puts a message in the status line when you click the button: <button name="button1" onClick="window.status='You clicked the button!'; return true">Click me</button> Here’s a script that lets you change the background color of your page: <button name="button2" onClick="document.bgColor=' yellow'">Change me</button> What about using your button as a link? Here is a script that will send you to another page: <button name="button3" onClick="window.location=' filters.htm'">Look at this</button> |
More information Changing the appearance of links Changing pictures with the mouse Expanding and contracting outlines Displaying a message in the status bar Displaying a page in a new window Using a button to run a script |