I'm working on this currently:
- I have a div "out" and a button "in".
- Click the button, Create div "extra" and button "extra_b"
- At the same time, "out"and "in" hide.
- click "extra_b", "out"and "in" appears, and DELETE "extra" and button "extra_b"
Here is the sample:FIDDLE
It can't work, and after I checked console, It probably tells me:
inner.onclick=function(){ add(outer[i]) };
unable to pass the object of current out element to the function correctly:
function add(objectIn){
}
Could you please tell me how to pass the elements to a function in a recursion? And how to modify my current code to make it run correctly?
Thanks a lot!