vendredi 30 septembre 2016

Add query string to Image Source(img src) if it has a particular class or ID

I want this in either PHP or JS. Its like, if img has particular class them a query string will be appended to its source url. Lets assume, the particular class is 'hello' & query string is '?source=fb' So, if img has class 'hello' -

<img class="hello" src="http://ift.tt/2dcfTnw">

The PHP should check & append it to the img src.

Any function that can do this?

Aucun commentaire:

Enregistrer un commentaire