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);
Also in JavaScript:
- how to generate a random number between 1 and 6 in javascript
- pass element from child to parent react
- colors in node js console
- node silent print to themral
- javascript clear form after dubmit
- reverse keys and values in object javascript
- ways to show image in react native
- make angular to run on a different port
- check if click is inside div javascript
- js when key is pressed
- javascript add class
- javascript multiple startswith
- get random entry from array javascript
- use property in angular 8
- not equal to in js
- react project ideas
- slick js's alternatives
- syntax for srcset in react
- jquery create element properties
- recursion in javascript
- how to get a particular line from a file in nodejs
- multi-dimensional array js
- get selected option value
- angular img