Little bit of jquery help for Pinterest Optimization

Hello, I am trying to control what can be pinned and how it gets pinned. I’ve set up a pin button that chooses the image I want and that is all working well. The only issue is that I can’t add the nopin custom attribute to images in the rich text field. I’m thinking a simple jquery will do the trick, but it’s a little outside my wheelhouse. This is what I have:

$(".w-richtext img").attr("nopin", "nopin");

Any thoughts?

Share link: https://preview.webflow.com/preview/katieschwarzdesign?preview=6dc63f15ca0089d5d31fcf0d33f3066d
Wanting to implement this on my Resources and Projects CMS template pages.