Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Displaying images from pool by referring to a variable in inline_html/javascript

Hello!

My question is similar to the post below, only I am trying to achieve sort of the same thing with html and javascript.

I have created a custom form with inline_html and I want to loop through a list of image names stored in a variable named "image."

<img src = {image}>

This wont work of course because I have to access the pool but I'm not sure if I can do that using a variable.

<img id = 'stim'/>
<script>
document.getElementById('stim').src = pool[(image)].data.src
</script>

Clearly, I'm lost when it comes to the syntax! Is there a way to achieve what I'm thinking?

Thanks!

Comments

Sign In or Register to comment.