0

How can i select the pseudo class :after of this ?

I try

$( this ).find( ':after' ).css("display","block");

but it didn't work !

Hayi
  • 6,972
  • 26
  • 80
  • 139
  • fiddle please..and its not understandable what you want – Ehsan Sajjad May 31 '14 at 14:24
  • I don't think you can do this. `:before` and `:after` pseudo-classes don't exist in the DOM. – Barmar May 31 '14 at 14:25
  • Duplicate of [Access the css ":after" selector with jQuery](http://stackoverflow.com/questions/17788990/access-the-css-after-selector-with-jquery) and [Manipulating CSS pseudo-elements using jQuery (e.g. :before and :after)](http://stackoverflow.com/questions/5041494/manipulating-css-pseudo-elements-using-jquery-e-g-before-and-after/21709814) – Joe May 31 '14 at 14:25

1 Answers1

1

There isn't a way to select pseudoclass directly in jQuery as it isn't a part of DOM

You can append the <style> though:

$('head').append('<style>element:before{ /* apply styles here */ }</style>');
Amit Joki
  • 58,320
  • 7
  • 77
  • 95