Answers for "append string in variable using jquery in each loop"

0

append string in variable using jquery in each loop

var gethtml ='';
$('.nav li').each(function(){
    var img_link = $(this).attr('data-menu');
    gethtml += '<img src="'+img_link+'">';
});
$('.main-img').html(gethtml);
Posted by: Guest on October-16-2020

Code answers related to "append string in variable using jquery in each loop"

Code answers related to "Javascript"

Browse Popular Code Answers by Language