Given an orderered list
<ol>
<li id="item">ipsum</li>
<li id="other">lorem</li>
<ol>
<span>The item <cite src="other?"></cite> is an item.</span>
Is it possible to reference the listed items by their ordinal value? e.g. if I write <cite src="other"><cite>
, it would appear as Item (2)
? I cannot know it's position in the list beforehand, so it would need to be done automatically in some way; is this possible in css?
Expected output:
- ipsum
- lorem
The item 2. is an item.
Essentially the <cite src="other"><cite>
should copy the content of the ordinal value.
If such solution cannot be attained with the current limitations of CSS, a JavaScript solution would suffice.