I have some tabular data and I need to put them into an array so I can look for a match elsewhere in the code. So I need to convert this:
<td> Name 1 </td>
<td> Name 2 </td>
<td> Name 3 </td>
into:
['Name 1', 'Name 2', 'Name 3']
This does not work:
$('td').text().toArray();
I really hoped it would :) I need to take the text of an input and compare it to the existing <td>s to make sure it's unique, so if there is a better way of going about it, I'd love to hear it. I know I could create an empty array, create a loop or use $.each() and push() each .text() to the array, but there has got to be a more concise way.