0

Nested divs javascript

Hey guys, I've been trying to write a code that creates nested divs. So far I've written one a bit close to that, but the problem is it's not nesting under the appropriate div. It's just nesting under the last div. I've tried all I could, pls help. The code is in the link below. https://jsfiddle.net/o9h5c9k3/37/ Sorry you have to visit the fiddle. I tried the code in SoloLearn but for some weird reason the handlers didn't run at all. https://code.sololearn.com/WreMTjWKRJ0k/?ref=app

18th Apr 2018, 12:29 PM
Akuoma Joshua
Akuoma Joshua - avatar
3 ответов
+ 1
first things first,whenever youre writing js on sololearn,your starting functions must be triggered by window.onload,else youll be getting undefined errors
18th Apr 2018, 12:48 PM
᠌᠌Code X
᠌᠌Code X - avatar
0
Thanks alot @Brains! That worked. Could you please help with the nested divs issue?
18th Apr 2018, 8:24 PM
Akuoma Joshua
Akuoma Joshua - avatar
0
The issue is when I press the add button, the new text should go under the immediate one whose add button was pressed. That's not happening. All I know is it's an issue in the views object, most likely the displayCodo function. please help.
19th Apr 2018, 6:07 AM
Akuoma Joshua
Akuoma Joshua - avatar