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
Post a Comment