I would like to get the url from <div class="ms-vb itx"> and replace it into a href within a span below.
Would that be doable in Jquery?
does that make sense?
<td height="100%" class="ms-vb-title ms-vb-lastCell" onmouseover="OnChildItem(this)">
<div eventtype="" perm="0x7fffffffffffffff" field="LinkTitle" id="5" ctxname="ctx6" onmouseover="OnItem(this)" class="ms-vb itx">
<a target="_self" onclick="EditLink2(this,6);return false;" href="/_layouts/RF.Portal.Web/DetailActualite.aspx?4&ListId={5B770E71-5269-4F45-87A0-2DEFA1136E40}&ID=5&ContentTypeID=0x0100FBEA8B5F8E1448F4B48C33A18522E2DA01001677EA3C9B9802408D15440E3B1906DE" onfocus="OnLink(this)">icitait l'honneur d'être reçu,</a>
<img class="ms-newgif" title="Nouveau" alt="Nouveau" src="/_layouts/1036/images/new.gif">
</div>
<div onmouseover="OnChildItem(this.parentNode); return false;" class="s4-ctx" style="top: 52px; left: 1015px; height: 105px; line-height: 105px; margin: 0px;">
<span> </span>
<a title="Menu Ouvrir" href="javascript:;" onclick="PopMenuFromChevron(event); return false;" onfocus="OnChildItem(this.parentNode.parentNode); return false;">
<img style="visibility: hidden;" src="/_layouts/images/ecbarw.png" alt="Menu Ouvrir"></a>
<span>
</span>
</div>
<span style="color: rgb(128, 128, 128);"><em>
Publié le 07/03/2011 11:30 -
En cours</em></span><br> et ayant nom Athos, Porthos et Aramis. Nous l'avouons, ces trois noms étrange<br><br>
<span style="font-size: 0.9em; color: rgb(128, 128, 128);" id="lireArticle">
<a class="rfr-link-action" href="DispForm.aspx?ID=5">Lire l'article</a>
<br><br></span>
</td>
Sure, you just have to make sure that you select the right elements.
E.g.:
If you have more elements with these classes and you want to perform this for every of them, you can use
each():Update:
Ok, I assume you have several of these
divs inside your table and you want to do this for all of them.The
aelement you want to change seems to have a classrfr-link-action, so you can make use of this. Note, although yourspanelement has an ID, IDs have to be unique in the document. No two elements can have the same ID.