javascript - Jquery Each function,show values in div -
i have simple json array , each function:
var result= $.each(response.data, function(k, v) { console.log(k); }); now, work fine, in console values json. so, there possibility values of array show in html page,in div, etc:
<div id="my_div"> </div> i try append() , html functions, blank div.
thanks
html
<div id="my_div"></div> js
var thedata = ['a','b','c','d']; $.each(thedata, function(k, v) { $('#my_div').append(v+'<br/>'); }); this answer may useful too: https://stackoverflow.com/a/2342433/3052648
Comments
Post a Comment