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

Using Buttons

We’ve seen buttons since as far back as Chapter 1. Here’s an example that displays an alert box using an <INPUT> type button’s ONCLICK event attribute that we saw in that chapter:

<HTML> 
    <HEAD> 
        <TITLE> 
            Executing Scripts in Response to User Action 
        </TITLE> 
        <SCRIPT LANGUAGE="JavaScript"> 
            <!--
            function alerter()
					{
					window.alert("You clicked the button!")
					} 
            // --> 
        </SCRIPT> 
    </HEAD> 

    <BODY> 
        <H1>Executing Scripts in Response to User Action</H1> 
        <FORM> 
            <INPUT TYPE="BUTTON" ONCLICK="alerter()" VALUE="Click Me!"> 
        </FORM> 
    </BODY> 
</HTML> 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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