Question

I have a group of some number of tags like these:

<a href="attachment/72" mime="image" target="_blank" class="value attachment">Filename.jpg</a>

<a href="attachment/73" mime="archive" target="_blank" class="value attachment">Filename.zip</a>

Is it possible to select with jQuery only anchors with attribute "mime" set to "image"?

Était-ce utile?

La solution

Try this :

$('a[mime=image]');

Autres conseils

use Attribute selector in jquery like this

$("a[mime=image]").attr("href" , "image.png");

or if you want only archive attribute means

 $("a[mime=archive]").attr("id" , "someId");
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top