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

Changing Properties

Making your web pages dynamic can be as easy as setting visual properties at runtime—browsers didn’t used to change their displays when you did so, but since IE4, they do. Here’s an example that changes the background color of a web page to green when the user clicks it (you’ll need version 6+ if you’re using Netscape Navigator):

(Listing 16-01.html on the web site)

<HTML> 
    <HEAD> 
        <TITLE> 
            Setting Background Color 
        </TITLE> 
    </HEAD> 

    <BODY ONMOUSEDOWN="document.bgColor='green'"> 
        <H1> 
            Click this page to turn it green. 
        </H1> 
    </BODY> 
</HTML> 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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