I'm attempting to replicate the content below inside a DIV
.
<ul class="pie-legend"><li><span style="background-color:#0066CC"></span>10-0-1</li><li><span style="background-color:#33CC33"></span>10-0-4</li><li><span style="background-color:#CC3399"></span>10-0-7</li></ul>
(The above is stored in a variable named legend)
I've utilized the append method to achieve this. It's functional, however, it isn't able to retain its styling.
Here is the jQuery and HTML code I am using:
HTML:
<div id="legend"></div>
Javascript:
var legend = PieChart.generateLegend();
$('#legend').append(legend);
Could you please point out what might be incorrect with this setup?