jeudi 13 août 2015

Replace text with patterns in JQuery

I want to search this in JQuery:

<a target="_blank" class="marked user-link" href="/user/'.$user->getUUID().'">
    <img class="avatar-big-shadow" src="/avatars/' . $user->getUUID() . '.png" alt="' . $user->getMinecraft() . '">
    '<span>'.$user->getMinecraft().'</span>
</a>

This Code looks like this, when someone runs the page:

<a target="_blank" class="marked user-link" href="/user/a9641490-56e7-41c8-a4d7-3bb0b96d5d8a">
    <img class="avatar-big-shadow" src="/avatars/a9641490-56e7-41c8-a4d7-3bb0b96d5d8a.png" alt="Hawked"><span>Hawked</span>
</a>

I think, I have to work with patterns other something similar, because as you can see, that there is dynamic content in my html code.

Now I need a pattern that makes this code to: Hawked. So I want to change it to the content in my tags.

Please notice, that the tag is surrounded by other words or / and html elements.

Greets

Aucun commentaire:

Enregistrer un commentaire