F
F
fandorin_official2018-03-03 11:44:27
JavaScript
fandorin_official, 2018-03-03 11:44:27

How to read the second element of a continuously updated table?

Through this code I get the value (number) from the table:

var temperature = $('table#DataTables_Table_0 tr:eq(1) td:eq(6)').text();

The table is updated regularly. If you specify a table line through tr:eq(1) - then sometimes the third or even fourth line can be read. But how to make the selection on the second line not through a number, but like lastChild, but only the second one?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Skibin, 2018-03-03
@megafax

Reduce the amount of code between element selection and value output. Those. choose the value right before outputting.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question