how to find an element with a property with javascript

Viewed 27

I have a list of images in my html, and the only way to differenciate them is by the property wcmcode.

<img class="" src="img1" wcmcode="1">
<img class="" src="img2" wcmcode="2">
<img class="" src="img3" wcmcode="3">

I'm not able to find how to access to this element. I imagine something like this:

document.querySelectorAll('img');

as starting point, but not able to find how to, my idea is a selector with the wcmcode as parameter.

any idea on how to do it?

0 Answers
Related