0

Possible Duplicate:
Setting CSS pseudo-class rules from JavaScript

How do you do something equal to:

::selection {
    color: #FFF;
}

in javascript?

Community
  • 1
  • 1
Peter
  • 936
  • 9
  • 23
  • 1
    @Pumbaa80: `::selection` is not a pseudo-class, though the principle of using JS to modify the document styles does apply. – BoltClock Oct 06 '12 at 19:57

1 Answers1

2
.foobar::selection {
    color: #FFF;
}

element.className += " foobar";
I Hate Lazy
  • 45,169
  • 12
  • 84
  • 76