How would I output this data using Jquery.each() to loop over the following array using Jquery?
var data = [
{
value: 36,
color:"#89228f",
legend:"My title"
},
{
value: 12,
color:"#89288f",
legend:"This title"
}
]
I would like to output the results like this
<li><div class="colorblock" style="background-color:#89288f"></div> <div class="legend">This title</div></li>
<li><div class="colorblock" style="background-color:#89228f"></div> <div class="legend">My title</div></li>