my data.json looks like this:
{
"selection_form" : {
"entities" : {
"name":"0002" ,
"name":"0103" ,
"name":"0104" ,
"name":"0122" ,
....
this script looks loke this
<script>
$.getJSON('data.json', function(data) {
$.each(data.selection_form.entities, function(i,item){
$("#enity").append('<p>'+data.selection_form.entities.name+'</p>');
});
});
</script>
i want to get all names wraped in a p tag like
<p>0002</p><p>0103</p>....
but the result is ony the last name item. I can't find a soloution for that. Need help!