jQuery .click() event for CSS pseudoelement (:befo

2019-06-14 22:39发布

I want to trigger a jQuery animation when content that I am inserting through the CSS pseudoelements :before: and :after is clicked. However, I'm not sure how to do this; my first guess, $(#id:before).click() didn't work. Is this part of jQuery's functionality? If so, how would I select the before/after content?

1条回答
Juvenile、少年°
2楼-- · 2019-06-14 22:49

jQuery does not support the CSS :before and :after selectors. To select siblings, use .siblings() and then filter from there.

http://api.jquery.com/siblings/

查看更多
登录 后发表回答