Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. pseudo-elements and pseudo-classes

pseudo-elements and pseudo-classes

Scheduled Pinned Locked Moved Web Development
questionjavascripthelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ali Al Omairi Abu AlHassan
    wrote on last edited by
    #1

    guys; I just searched Google for pseudo-elements and pseudo-classes and i found examples on them. (:before, :first-line, :first-letter, :target, :lang, :checked, and :first-child). my question is: if in jquery selectors ':myfilter' means that the elements should be filtered according to myfilter filter, so how can I select a pseudo-element using jquery.

    Help people,so poeple can help you.

    Richard DeemingR 1 Reply Last reply
    0
    • A Ali Al Omairi Abu AlHassan

      guys; I just searched Google for pseudo-elements and pseudo-classes and i found examples on them. (:before, :first-line, :first-letter, :target, :lang, :checked, and :first-child). my question is: if in jquery selectors ':myfilter' means that the elements should be filtered according to myfilter filter, so how can I select a pseudo-element using jquery.

      Help people,so poeple can help you.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      The :first-child[^], :checked[^], :target[^] and :lang()[^] selectors are all supported by jQuery: http://api.jquery.com/category/selectors/[^] :first-line and :first-letter aren't directly supported, but you might be able to find ways to work around it. For example, this SO answer[^] has a function to return the first line of an element, but it involves a lot of DOM manipulation. :before doesn't exist in the DOM, so there's really no way to manipulate it using jQuery.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      A 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        The :first-child[^], :checked[^], :target[^] and :lang()[^] selectors are all supported by jQuery: http://api.jquery.com/category/selectors/[^] :first-line and :first-letter aren't directly supported, but you might be able to find ways to work around it. For example, this SO answer[^] has a function to return the first line of an element, but it involves a lot of DOM manipulation. :before doesn't exist in the DOM, so there's really no way to manipulate it using jQuery.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        A Offline
        A Offline
        Ali Al Omairi Abu AlHassan
        wrote on last edited by
        #3

        Thanks, Richard. This is disappointing, In google chrome inspect element, you can see the pseudo-elements :before and :after presented as separate nodes like ::bafore and ::after. but i couldn't fetch them using .chldren, .childNodes, nor with JQuery.

        Help people,so poeple can help you.

        L 1 Reply Last reply
        0
        • A Ali Al Omairi Abu AlHassan

          Thanks, Richard. This is disappointing, In google chrome inspect element, you can see the pseudo-elements :before and :after presented as separate nodes like ::bafore and ::after. but i couldn't fetch them using .chldren, .childNodes, nor with JQuery.

          Help people,so poeple can help you.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Description: Get the immediately preceding sibling[^] of each element in the set of matched elements, optionally filtered by a selector.

          You can go sleep at home tonight if you can get up and walk away

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups