Hey fellow css and jquery fans,
(i hope it’s okay to post this here as i saw other jquery threads around. Maybe there should be seperate jquery forum?)
anyway:
i am trying to pull all headings out of a page and create a unordered
list in the sidebar, which should then act as navigation help.
Code:
$(document).ready(function() {
$(‘#sidebar #references’).after(“
“);
$(‘.main h3.caps a’).each(function(i, val) {
$(‘ul.subnav’).append(this.firstChild);
});
});
I am able to append the anchors, but i can’t create
the list. I was looking at the wrap-function of jquery, but didn’t
figure out how to use it in this scenario. Also, i am actually "pulling out" the anchors of the main page so they are "cut & pasted" in the sidebar. Of course, i only want to copy their values..
Can somebody explain me how to get the copy-value of this.firstChild
sorrounded by "<li></li>"?
aah and here is my html markup:
Main-content:
==========
Sidebar:
=======
Thanks in advance,
Michael