javascript - Append a div to a new div -


i using ipb , going put each category new tab category div this:

<div id='category_100'> <div id='category_104'> <div id='category_102'> <div id='category_101'> 

and tabs content this:

<div class="content">                     <div id="content-1" class="content-1">                      </div> </div> 

and categories divs showing want moved content-1 div without duplicate want move div div jjava script how?

<script>   document.getelementbyid('content-1').appendchild(     document.getelementbyid('category_100')   ); </script> 

this worked me how can add more id category_100

i want in 1 script code not repeart scrip code 4 times:

<div class="content">                     <div id="content-1" class="content-1">                         <div id='category_100'> <div id='category_104'> <div id='category_102'> <div id='category_101'>                      </div> </div> 

using 2 lines suggested things here not working!

try code :

$('div[id^="category_"]').appendto('#content-1') 

have fiddle : http://jsfiddle.net/lulu3030/sjepx/2/


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -