I have this loop data in javascript. And i want to place html css and php for each value.
var html = '';
$.each(data, function(name, value) {
html += value.email + "<br />" + value.content + "<br />";
});
$('#sidebarColumn').html(html);
Here i just listed out some values. Lets say i want to have
<span class="userEmail">value.email<span>
<div class="userContent">value.content</div>
<img src="<?php echo base_url() ?> value.picture" />
How can i place them in JS or there is alternative way to make code readable?
Note* i using .html() here because i want to replace #sidebarColumn previous data and place the loop data in that div