I'm trying to get the JQuery right to select the text from the following html structure:
<TABLE class=ms-formtable>
<TBODY>
<TR></TR>
<TR></TR>
<TR></TR>
<TR></TR>
<TR></TR>
<TR>
<TD><H3><NOBR>Select this text</NOBR></H3></TD>
<TD></TD>
</TR>
</TBODY>
</TABLE>
Could you perhaps use an ID to specify your H3 tag and therefore be able to select it using something like
$('#textToSelect').text()
.That way you could be absolutely sure which text you were targeting on the page.
There is a number of ways of doing that. Is this the only table with that class name? My guess is
$('table.ms-formtable nobr').text()
, but it depends on the rest of the HTML, because this could select more than one element's text.simple selector
more explicit selector
An example to play with