HTML ..jQuery .. tirant une chaîne avant l'élément courant
<div class="row">
<div>
<b>Title A</b> <a href="#">Link 1</a> <a href="#">Link 2</a>
</div>
Content A
</div>
<div class="row">
<div>
<b>Title B</b> <a href="#">Link 1</a> <a href="#">Link 2</a>
</div>
Content B
</div>
<div class="row">
<div>
<b>Title C</b> <a href="#">Link 1</a> <a href="#">Link 2</a>
</div>
Content C
</div>
jQuery ..
Jusqu'à présent, mon JS ajoute un lien "Link 3" après chaque "Link 2" ..
$("a:contains('Link 2')").each(function(){
$(this).after(' <a href="#">Link 3</a>');
});
Pour chaque élément de la boucle, comment accéder au titre?
$("a:contains('Link 2')").each(function(){
// I need to find the title string for each row. So is there a way to find elements before the $(this) identifier?
$(this).after(' <a href="#">Link 3</a>');
});