javascript - JQuery - how to store each data received -
javascript - JQuery - how to store each data received -
how store info received below jquery farther use.
$('#div').find('a').each(function() { console.log($(this).attr('href')); });
http://jsfiddle.net/mvm6o208/ can find code here.
make array , force values it. like
var store = []; $('#div').find('a').each(function() { store.push($(this).attr('href')); });
update : according html in fiddle have posted, selector should $('div').find('a')
instead of $('#div').find('a')
, dont have div id div
. see working fiddle here.
also per the inputs comments below, faster approach force array via
store[store.length] = $(this).attr('href');
javascript jquery arrays
Comments
Post a Comment