• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting DOM properties

 
Higgledy Smith
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the document doesn't exist yet. Use an onload handler to delay execution until after the DOM exists.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic