I
I
Ilya Bobkov2015-10-30 15:00:19
JavaScript
Ilya Bobkov, 2015-10-30 15:00:19

How to scan the first column of a table?

Hey! There is a table in the first column of which there are values. How can these values ​​be displayed in an alert, for example?

onetext
2text
3text


<table>
<tr><td>1</td><td>text</td></tr>
<tr><td>2</td><td>text</td></tr>
<tr><td>3</td><td>text</td></tr>
</table>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Demidov, 2015-10-30
@heksen

$('table tr').each(function(){
  alert($('td:first', this).text());
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question