Francisco G Francisco G - 1 year ago 68
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?

Answer Source

Almost there. Try this:

var value = $("#table-draggable-2 > tr:first > td > b").text();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download