jQuery - add variable into HTML string

0 votes
109 views
added Aug 14, 2019 in jQuery by LC Marshal Captain (25,770 points)
var bgImg = 'https://lazacode.org/img/img.jpg';
heroBg.after('<div class="hero-bg-clone" style="background-image: url('+bgImg+');"></div>');

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...