dimanche 10 juillet 2016

How to merge parent content inside his first child with jQuery

I'm not able to figure out how to merge parent content inside his first child with jQuery. I want to merge all the elements (including text node) of a element within its<a>child.

I have this :

<td class="row">
    <a href="#">
        <span class="iconouter">
            <img class="icon" src="...">
        </span>
        Type of document
    </a> 
    : Form 
    <span class="type-nb">(1)</span>
</td>

And I want to do this :

<td class="row">
        <a href="#">
            <span class="iconouter">
                <img class="icon" src="...">
            </span>
            Type of document: Form <span class="type-nb">(1)</span>
        </a>
    </td>

Aucun commentaire:

Enregistrer un commentaire