Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74381

I have some html and I need to get html into JSON Array using jQuery with lambda expression

$
0
0

Hi I have some html and i need to get html into JSON Array using jQuery with lambda expression.

<div id="main">
        <ul class="level_0">
            <li>A
                <ul class="level_1">
                    <li>a</li>
                    <li>b</li>
                    <li>c</li>
                </ul></li>
             <li>B</li>
             <li>C</li>
      </ul>
</div>

I want JSON Array like

[{
     'A',
     {'a','b','c'},
     'B',
     'C'
}]

I'm trying like this

var m= f = (d)=> $(d).children().length>0 ? $(d).html(): f($d)

Viewing all articles
Browse latest Browse all 74381

Latest Images

Trending Articles



Latest Images