• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Using relative image path as parameter instead of using this

Resolved: Using relative image path as parameter instead of using this

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I’m trying to make an simple Tab Gallery based on the one found at W3Schools.
However I want to be able to use a relative image path instead of using ‘this’ when calling myFunction. But I don’t know how to do that.
As you can see in the Html, I have tried using a relative path for the second image, which doesn’t work. My structure is, index.html + main.css + script.js are all in the same folder and then I have a folder called ‘img’ for the images.


Answer:

using “this” is easier and shorter than use relative path but if you still want please try this:
HTML:
JS:

If you have better answer, please add a comment about this, thank you!

css html image-gallery javascript relative-path
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I implement a function depending on picked up items?

01/04/2023

Resolved: Azuer Service Bus SDK not receiving the specified messages

01/04/2023

Resolved: how to change date format from 201904 to Apr-19 in excel

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.