Francisco G Francisco G - 3 months ago 12x
Javascript Question

Select text inside <b></b> tags

I think is a simple question, but I am having some issues with that.

I need to get the value between


It is inside of a tbody, tr, and td.

Here is the HTML

<table class="table table-bordered table-striped">
<tbody class="connectedSortable" id="table-draggable-@i">
<td align="center">

My jQuery is the following:

$("#table-draggable-2 > tr:first > td > b")

And as a result I get:


But I just need the 2017 value. What am I missing?


Almost there. Try this:

var value = $("#table-draggable-2 > tr:first > td > b").text();