JSFiddle - React, Tailwind, and code Playground

HTML

<dl>
    <dt>A</dt>
    <dt>B</dt>
    <dt>C</dt>
    <dd>text</dd>
</dl>

<table>
    <tbody>
        <tr>
            <td>$("dt + dt ~ dd").length</td><th></th>
        </tr>
        <tr>
            <td>$("dt:contains(B) + dt ~ dd").length</td><th></th>
        </tr>
        <tr>
            <td>$("dt:contains(A) + dt ~ dd").length</td><th></th>
        </tr>
    </tbody>
</table>

CSS

th {
    padding: 0 3px;
}

JavaScript

$("td:first-child").each(function(){
    $(this).next().text( eval($(this).text()) );
});