JavaScript for WordPress Forums Gutenberg Development Loop through attributes

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #139277
    chrisdavies71
    Participant

    Hi Zac,

    How do I loop through attributes?

    I have an attribute of imgID and need to create an <li> element for each one, but the number of images could change so this needs to be dynamic in someway.

    I have looked at the Gutenberg Gallery block for inspiration and that uses .map but I am not sure how to implement that into my block.

    Regards

    Chris

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.