【问题标题】:Select the pseudo class :after [duplicate]选择伪类:after [重复]
【发布时间】:2014-07-21 04:30:23
【问题描述】:

如何选择this的伪类:after

我试试

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

但它没有工作!

【问题讨论】:

标签: javascript jquery css


【解决方案1】:

没有办法直接在 jQuery 中选择伪类,因为它不是 DOM 的一部分

您可以附加<style>

$('head').append('<style>element:before{ /* apply styles here */ }</style>');

【讨论】:

    猜你喜欢
    • 2012-05-31
    • 2013-08-30
    • 2012-07-06
    • 2016-12-25
    • 2016-11-30
    • 1970-01-01
    • 2016-08-25
    • 2022-01-02
    • 2022-01-02
    相关资源
    最近更新 更多