www.webdeveloper.com
Results 1 to 2 of 2

Thread: trouble accessing a pseudo element

  1. #1
    Join Date
    Nov 2005
    Location
    Bundanoon: first village to ban bottled water
    Posts
    214

    Question trouble accessing a pseudo element

    I have a bunch of elements formed this way:
    HTML Code:
    <p class="T">some text</p>
    and some css:
    Code:
    .T:after { position:relative; visibility:hidden; content: " more text." }
    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") }	
    	}
    }
    Any suggestions?
    Last edited by ctoz; 09-12-2009 at 02:50 AM. Reason: additional code

  2. #2
    Join Date
    Nov 2005
    Location
    Bundanoon: first village to ban bottled water
    Posts
    214

    Smile

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles