简体   繁体   中英

How to edit element created in CSS with :after using jQuery?

I have created an element in CSS with pseudo-class :after. Is there a way to change it's CSS properties from jQuery?

I thinks you want

$('#object_id:after').css({
  color: blue
});

Your question seems a little vague. You can change the css properties of anything in the DOM by using the css() method, like so:

$('#my-thing').css({
  fontSize: 10em,
  width: 100px
});

If you're asking about getting something with the :after pseudoclass, refer to this answered quesion

Hope this helps you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM