Web hosting services - 320Part IIIDocument Objects ReferenceAs the document loads, the

320Part IIIDocument Objects ReferenceAs the document loads, the three spanelements for the colored bars are given no width, which means that they assume the default width of zero. But after the page loads, the onloadevent handler invokes the init()function, which sets the initial values for each bar s widthand the text (innerHTML) of the three labeled spans. Once these initial values are set, theinit()function invokes the updateClock()function. In the updateClock()function, a new date object is created for the current instant. The document.recalc()method is called, instructing the browser to recalculate the expressionsthat were set in the init()function and assign the new values to the properties. To keep theclock ticking, the setTimeout()method is set to invoke this same updateClock()func- tion in one second. To see what the getExpression()method does, you can click the button on the page. It simplydisplays the returned value for one of the attributes that you assign using setExpression(). Listing 15-32: Dynamic Properties