- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2021
07:47 AM
04-23-2021
07:47 AM
How to add images in js
How to include images in js,
My code :
if (firstStore.address && firstStore.state && firstStore.zip && firstStore.store_hours_weekdays && firstStore.store_hours_weekend_days && firstStore.phone ) { homeAddress = '<div class="homepage-store">' + firstStore.address + ',' + firstStore.state + ' ,' + firstStore.zip + '<br><br> ' <<add image here>> + firstStore.store_hours_weekdays +' <br> ' +firstStore.store_hours_weekend_days+ ' <br><br> ' <<add image here >> + firstStore.phone + '</div>'; }
Labels:
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2021
12:13 AM
08-07-2021
12:13 AM
Re: How to add images in js
There is multiple ways to insert the image in the js code, one of the pretty simple example code is here :
// Url of the Image var url = 'www.imageurl.com'; // HTML Image tag var imageTag = '<img src="' + url + '" alt="image" />'; if (firstStore.address && firstStore.state && firstStore.zip && firstStore.store_hours_weekdays && firstStore.store_hours_weekend_days && firstStore.phone ) { homeAddress = '<div class="homepage-store">' + firstStore.address + ',' + firstStore.state + ' ,' + firstStore.zip + '<br><br> ' + imageTag + firstStore.store_hours_weekdays +' <br> ' +firstStore.store_hours_weekend_days+ ' <br><br> ' + imageTag + firstStore.phone + '</div>'; }
Problem Solved !!
Click on 'Kudos' & Accept as Solution to encourage to write more answers !