I would like to generate the following object:
var ideaBoard = {
"Staff Retreat" : {
"Games" : [
{"title" : "Rockband", "details" : "1hr"},
{"title" : "Texas Hold em", "details" : "30min"}
],
"Talks" : [
{"title" : "The Old You", "details" : "Dr. Smith"}
]
}
}
from the following HTML:
<div id="data">
<ul><span class="board-title">Staff Retreat</span>
<li><span class="category-title">Games</span>
<ul>
<li>
<span class="title">Rockband</span>
<span class="details">1hr</span>
</li>
<li>
<span class="title">Texas Hold em</span>
<span class="details">30min</span>
</li>
</ul>
</li>
<li><span class="category-title">Talks</span>
<ul>
<li>
<span class="title">The Old You</span>
<span class="details">Dr. Smith</span>
</li>
</ul>
</li>
</ul>
</div>
I'm new to loops/arrays/objects - so I really appreciate the help!
I'm using jQuery elsewhere in this project, if it helps.
Thanks!