How to take the value that is loose inside a div and ignore the values that are inside other tags inside the div, using jquery?

Asked

Viewed 41 times

0

I have the following HTML:

<tr>
    <td>
        VALOR PARA SER PEGO
        <span>Esse valor não é pra ser pego</span>
        <span>Esse valor também não é pra ser pego</span>
    </td>
</tr>

I exemplified what values I would like to take, notice that the "VALUE TO BE CAUGHT" is inside the div but loose inside, not inside tag <span>, how could I do to catch him?

I tried this way, but it brings me all the values, including those within the <span>, those inside the <span> I won’t use.

$("#tabela > tr > td").text();

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.