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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -