I’m trying to build a nested JSON list from UL/LI elements, but I just can’t get it work with recursion. I have an example here. You can see the javascript I’ve written and my ideal output.
Can anyone help me?!
I’m trying to build a nested JSON list from UL/LI elements, but I just can’t get it work with recursion. I have an example here. You can see the javascript I’ve written and my ideal output.
Can anyone help me?!
Yeah, I should have deleted this. It turned out to be a variable scope issue. Thanks though!