I am writing a script inside a tag.
<ul class="boxes_tree">
<li><strong>data</strong></li>
<script type="text/javascript">
var itemStr ='[data1,data2]';
itemStr=$.parseJSON(itemStr);
if(itemStr){
for (var key in itemStr)
{
if (itemStr.hasOwnProperty(key))
{
itemStr[key];
}
}
}
</script>
</ul>
now inplace of itemStr[key];
I want to add a li
tag with itemStr[key]
as content of li
tag.
How can I achieve this?