window下的getComputedStyle属性.getPropertyValue属性
// 获取 .element:before 的 color 值
var color = window.getComputedStyle(
document.querySelector('.element'), ':before'
).getPropertyValue('color');

// 获取 .element:before 的 content 值
var content = window.getComputedStyle(
document.querySelector('.element'), ':before'
).getPropertyValue('content');

相关文章:

  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-07
  • 2021-12-27
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
相关资源
相似解决方案