I've got an html table:
<table><tr>
<td>M1</td>
<td>M2</td>
<td>M3</td>
<td>M4</td>
</tr></table>
and a simple jQ script:
$('td').click(function(){ alert( $(this).html() ); });
That works just fine.... but in the real world, I've got several hundred table cells and the code is formatted improperly in places because of several people editing the page.
So if the html is:
<td>
M1
</td>
then the alert() is giving me all the tabs and returns and spaces:
What can I do to get ONLY the text without the tabs and spaces? I've tried .html(), .val(), .text() to no avail. Thanks!