tags:

views:

94

answers:

1

Hi,

I want to break my <ul> into multiple <ul> tags, I have 10 <li> in my <ul> and I want to break into 2 <ul> (5 <li> each). To do the same, I am taking 5th <li> and appending </ul><ul> using $(this).after().

But Jquery automatically reverse the text and auto close the <ul>.

Any Idea how to disable to auto close?

Cheers, Felix

+2  A: 

You do not want to disable auto close. What you want is to add a new UL after the first one, and then add to that one, the last five LIs of the first list. To get a reference to the LIs following the first five, you can do:

$('myFirstUL li:gt(4)');

gt being greater than zero-based index.

Full code example: http://jsbin.com/ofowe/edit

David Hedlund
Thanks a lot, I took those li and put in different ul
Felix