PennController for IBEX › Forums › Support › How to make keypress add a CSS class to text › Reply To: How to make keypress add a CSS class to text

Hi, Jeremy! Things are much clearer now, thank you!!
I’ve read the documentation link you’ve sent me, thanks, but I’m still wondering about one thing:
If in the doc’s example, newText("dots", "...").print()
.dots {
text-decoration: underline;
}
equals
newText("dots")
.css("text-decoration","underline")
.print()
Then how come the the separed .css manipulation for “words” in the separed file be different from the one we have with the .css
in the code? From what I got from the doc, the .css
in the code points to the element itself (in the ex case, “dots”, in my case “word”), right? Hence, how can the separed one refer to all individual span classes and the .css one refer to all span classes, shouldn’t they both point to “words” ? (the element to each they’re attached to) ?