The way to update[ insert ] partial of the un-order list in multiple container div in jquery? -


e.g:

with only 1 container div :

<div id="container1">   <ul>     <li>i not part of update </>     <li> id fo container 1</li>   </ul> </div> 

and when adding new 1 div dynamic, want them be:

<div id="container1">   <ul>     <li>i not part of update </>     <li> id of container 1</li>     <li> id of container 2 added here </li>   </ul> </div>  <!-- container 2 should has both id of container 1 , 2 --> <div id="container2">   <ul>     <li>i not part of update </>     <li> id of container 1</li>     <li> id of container 2 added here </li>   </ul> </div> 

it means when create new container, new created container id should adding previous containers.

and problem how update id list of container when remove container.e.g:

when remove container1 , id list container should updated :

<div id="container2">   <ul>     <li>i not part of update </>     <!-- id of container 1 had been remove -->     <li> id of container 2 added here </li>   </ul> </div> 

thank much!!

html structure want this:

  <div id="container-list">     <div id="container1" class="container">       <ul>         <li>i not part of update </>         <li class="container1"> id fo container 1</li>         <li class="container2"> id fo container 2</li>       </ul>     </div>     ...   </div> 

adding new container:

var containerid = ... // next id $('container-list').append(/* new container html code */)  // appending <li> each of containers $('<li>').addclass(containerid).text(containerid).appendto('div.container ul') 

removing container:

var containerid = ... // container remove $('#' + containerid).remove() // remove container $('li.' + containerid).remove() // , remove mention 

Comments

Popular posts from this blog

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

apache - Add omitted ? to URLs -

php - How can I stop spam on my custom forum/blog? -