JSFiddle - React, Tailwind, and code Playground

by Sean Cannon

HTML

<div>
  <p>
    <img src="someImg.png"/>
    <p class="caption">
       This Picture was taken in Florida and the Picture ID is xxxxxx
    </p>
  </p>
  <p>
    <img src="someOtherImg.png"/>
    <p class="caption">
       This Picture was taken in New York and the Picture ID is yyyyyy
    </p>
  </p>

</div>

JavaScript

document
  .querySelectorAll('.caption')
  .forEach(el => el.innerHTML = el.innerHTML.replace(/.*(?=Picture ID)/, ''));