0

I did not the put the full code, it's a lot

I have the a countingdown script, Im trying to set a new string inside of this code, and then, call the same string to fill up a link inside html code.

Code

var events = [
      ["Example",["02:00","06:00","10:00","14:00","18:00","22:00"]], 
      ["Example2",["03:00","05:00","8:00","11:00","15:00","19:00"]],

Im trying to apply a different image name for each row that I have, I tried something like this:

I tried this:

 var events = [
    ["Example",["02:00","06:00","10:00","14:00","18:00","22:00"],["image.png"]],
    ["Example",["03:00","05:00","8:00","11:00","15:00","19:00"],["another-image.png"]],

My HTML output is like that:

<a href="#">' + line[0] + '<img src="https://mywebsite.com/images/'PRINT IMAGE.PNG HERE"></img>

I want to complete the link (example 3) with the value added (example 2) How can I call it properly? I cannot just fill the html with this name, cuz I need one different image for each row inside "var events".

Check this Image please, question explained.

Thank you

9
  • Sorry but I can not understand. Could you provide more information? What exactly do you want to achieve? Commented Jan 29, 2020 at 15:42
  • Yes, thanks, In the second example, I added ['image.png'], how can I call it inside of a html code. to print out the string and complete my link to the image. Commented Jan 29, 2020 at 15:43
  • If you need different images for each row, why is there only one image name in the array? Commented Jan 29, 2020 at 15:51
  • Because I put only enough code to make the question. I'll apply the same for another rows. Commented Jan 29, 2020 at 15:52
  • and I'm confused what the nested array of timestamps is for. Commented Jan 29, 2020 at 15:53

1 Answer 1

0

I think you are talking about parameters, every time you call the same funcion you want it to initiate but with different ids(show a different image), is that what you want? correct me to help you.

Sign up to request clarification or add additional context in comments.

2 Comments

I have all them initiated already, I cannot put the full code there, it's a lot. I just dont know how to call the new ["image.png"] inside a HTML link to be completed.
prnt.sc/qun2dd please, check this image. than you for your help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.