I read related posts, but didn't find a solution for IE, so I ask for a jQuery-solution for this problem:
I've some nested hierarchical Headings like this
<h1> heading 1</h1>
<h2> subheading 1</h2>
<h1> heading 2</h1>
<h2> subheading 1</h2>
<h2> subheading 2</h2>
I need some automated headings output like this:
1. heading 1
1.2 subheading 1
2. heading 2
2.1. subheading 1
2.2. subheading 2
Is there a way how this can be achieved using jQuery or alike, working in IE6+?
Here's my take on it:
Working example on all levels, H1 - H6
I think you should wrap H2 subheadings in DIV then use the following code:
try this
another possibility
honestor, simply speaking, the problem will be solved once we can get all the
<h2>
tags that follows right after every<h1>
tag and just before the next<h1>
tag, right ?This code has made it and working just fine
you can test it on this link
P.S: thanks for you MatejB, I didn't know jsfiddle.com before your post :)
This works for me:
Woking example on jsfiddle.