34,333
edits
Changes
→Making Basic Dynamic Style Changes
</pre>
Having gained access to the element object we can access the ''color'' property of the ''style'' object for this element and change the color:. the following example contains some text contained in a <P> tag assigned the ''id'' introtext. A button is created whiuchj calls the ''buttonPressed()'' function when clicked. the ''buttonPressed()'' functiopnm in turn access the element via the ''id'' and changes the color style to 'green'.
<pre>