Get id from a one div to another div

Posted by Jean on Stack Overflow See other posts from Stack Overflow or by Jean
Published on 2010-04-06T11:25:58Z Indexed on 2010/04/06 11:33 UTC
Read the original article Hit count: 162

Filed under:

Hello

Here are the two divs

<div id="1">

<span id="a1">first</span>
<span id="a2b">first</span>
<span id="a3">first</span>

</div>
Click
<div id=2></div>

And the jQuery code to do

  $('#2').bind('click',function(){
            var xx = $('#a'+i).attr('id');
            $('#2').append(xx);
            i=i+1;
        });

It does not get all the 3 id's from #1

Thanks Jean

© Stack Overflow or respective owner

Related posts about jQuery