Getting pseudo-element content in Chrome

后端 未结 1 1069
轻奢々
轻奢々 2021-01-07 06:09

I\'m having some trouble getting the generated content of a pseudo-element via Javascript in webkit browsers.

Context for those who care: I\'m working on a jQuery mo

1条回答
  •  情话喂你
    2021-01-07 06:33

    This question is quite old but if anyone is looking for a solution, this is how you do it:

    window.getComputedStyle(document.querySelector('#element'),':after').getPropertyValue('content')
    

    0 讨论(0)
提交回复
热议问题