/    Sign up×
Community /Pin to ProfileBookmark

trouble accessing a pseudo element

I have a bunch of elements formed this way:

[code=html]<p class=”T”>some text</p>[/code]

and some css:

[CODE].T:after { position:relative; visibility:hidden; content: ” more text.” }[/CODE]

Having trouble accessing “T:after” to change the visibility. Something like:

[CODE]
var elT = document.getElementsByClassName(“T”)

function changeT() {
for (i=0; i<elT.length; i++) {
if (elT.item(i).firstChild:after.style.visibility == “hidden”) {
elT.item(i).firstChild:after.style.visibility = “visible”) }
}
}
[/CODE]

Any suggestions?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@ctozauthorSep 14.2009 — Seems like it's not possible: alternative to changing a a css rule is to write it in: this means doing it two ways, MSIE's and everyone elses':

http://www.quirksmode.org/dom/w3c_css.html

Sure to be posting again.
×

Success!

Help @ctoz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...