-1

How can i get the incremental value of pseudo element's counter value.

counter(my-Counter-Variable , cjk-ideographic)

Is there any way in JavaScript to get the value of above counter content.

Thanks.

Pavan Tiwari
  • 3,077
  • 3
  • 31
  • 71
  • Possible duplicate of [How to access CSS generated content with JavaScript](https://stackoverflow.com/questions/2651739/how-to-access-css-generated-content-with-javascript) – Douwe de Haan Mar 31 '18 at 08:18

1 Answers1

0

You'd have to get the pseudo-element's content property using window.getComputedStyle() on the originating element (see How to access CSS generated content with JavaScript), and if the content property doesn't contain just the counter itself then you'll need to parse the value out of whatever string actually makes up the pseudo-element's content property. CSS doesn't expose the counter itself directly to you.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356