Jump to content

Photo gallery with caption at bottom

Recommended Posts

I have been trying to write a photo gallery with text accompanying it at the bottom. Photos and text will change with each click.

I tried using an input tag as child of form tag with javascript code and it worked. But the input tag is interactive and allows only one line. By the way, it doesn't respect the <a> tag for crediting the photos.


Therefore, I have been trying my hands on the figure element which will take the image tag and figcaption tag for photo and photo description. But, I cannot write the javascript.


can anyone show me how? I wonder why the input tag is easy but figure and figcaption is difficult?




Share this post

Link to post
Share on other sites

It looks like you can just set the innerHTML property for the figcaption element. You could use the same property with other elements like a div or a span also.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...