File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes setting DOM properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "setting DOM properties" Watch "setting DOM properties" New topic
Author

setting DOM properties

Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
I am reading JavaScript: A Beginner's Guide, Second Edition and stuck on setting DOM property (page 227)

The author specifically instructs the reader to set the the alinkColor property in a script in the head section of the html document. But this does not work. What does work is setting the alink property in the

Does anyone know why it is not working in the head section? I checked the book's eratta, but no mention this is an error.

Thank you.

higgledy

>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Because the document doesn't exist yet. Use an onload handler to delay execution until after the DOM exists.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setting DOM properties