How to limit the display of the content div json to three
<p>How can I limit the display of the content div JSON to three? Now the code shows all the items downloaded from JSON. I would like to only return 3 divs.</p>

<pre><code>&lt;div id="p"&gt;&lt;/div&gt;
</code></pre>

<pre class="lang-js prettyprint-override"><code>$.getJSON('element.json', function(data){
    var a = data.i;
    var d = $("&lt;div class='p1'&gt;");
    var ele = '';
    $.each(a,function(i,v){
        ele += "&lt;div class='k'&gt;"+ v.num + "&lt;/div&gt;";
    });
    d.html(ele);
    $("#p").append(a);
});
</code></pre>

<pre class="lang-js prettyprint-override"><code>{
    "i":[{
        "num": "1",
    },{
        "num": "1",
    },{
        "num": "3"
    },{
        "num": "4"
    },{
        "num": "5",
    }]
}
</code></pre>