1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Dec 2006
    IL, USA
    Rep Power

    Way to select (jQuery) :after css elements

    I have/want to put in some buttons for a div element using :after - i have them styled and everything, just I want them to be able to be clickable in order to do the action.

    I have tried a number of ways to do this via jQuery, yet no luck - are :after/:before elements not DOM?
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    USA (verifiably)
    Rep Power
    Correct. Pseudo-elements are not part of the DOM. I'd recommend that you make the parent of the button large enough so that the :after and :before stay within its bounds and apply the event handler to both the button and its parent (to work with all input devices).
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo