Hi!

I have the folowing HTML code:

<h1>heading 1</ h1>
<h2>heading 1.2 a </h2>
< h3>heading 1.2.3 a </h3>
<h3>heading 1.2.3 b </ h3>
<h2>heading 1.2 b </h2>
<h3 >heading 1.2.3 c </h3>
<h3>heading 1.2.3 d </h3>
< h3>heading 1.2.3 e </h3>
<h2>heading 2 b </ h2>

when apply this JQ:

var out = '';

$('h1,h2,h3,h4').each(function(i){
    out += i + ': ' + this.nodeName + "\n";
});

alert(out);

the result is:
0: [H3] heading 1.2.3 a
1: [H3] heading 1.2.3 b
2: [H3] heading 1.2.3 c
3: [H3] heading 1.2.3 d
4: [H3] heading 1.2.3 e
5: [H2] heading 1.2 a
6: [H2] heading 1.2 b
7: [H2] heading 2 b
8: [H1] heading 1

How to get the right element order?
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to