Create a stylesheet rule. Targets links in the :active state.
Append it. The browser applies it without Document color properties.
Same UX goal. Pressed-link color, without deprecated APIs.
Prefer static CSS in real projects (a <style> or stylesheet file).
Compatibility
Browser Support
Document.alinkColor is a legacy Document color property. MDN marks it Deprecated. It may still work for compatibility, but CSS :active is the supported approach.
✓ Deprecated
Document.alinkColor
Still readable in many browsers for old pages. Do not rely on it for new UI — use CSS link pseudo-classes.
It gets or sets the color of an active link in the document body. A link is active between mousedown and mouseup — while the user is pressing the mouse button on it (MDN).
Yes. MDN marks Document.alinkColor as Deprecated. Prefer CSS :active (and related link pseudo-classes) in new code.
A string color name (such as blue or darkorange) or a hexadecimal color (such as #0066CC). Setting null is converted to the empty string.
MDN notes the default alinkColor in Mozilla Firefox is red (#ee0000 in hexadecimal).
Legacy Document properties include linkColor (unvisited), vlinkColor (visited), and alinkColor (active/pressed). Modern CSS uses :link, :visited, and :active instead.
No. Style links with CSS — for example a:active { color: … }. Learn alinkColor only to read or migrate old scripts.