My JSON file contains a list of elements, each creating a container. See the code below:
$.getJSON('/data/risks.json', function(data) {
var html = '';
$.each(data.risk, function(key, value){
html += '<div class="elementlist">';
html += '<br><p><b>'+value.name+'</b><br><br>'+value.description+'</p>';
html += '</div>';
});
$('#list').html(html);
});
I now need to identify which container the user has clicked on. This code works for existing containers but not for those created from the JSON file. What would be the best approach to achieve this?
Regards