A tutorial I’m working on has the following code with the following comment. I don’t understand…
i) the comment, specifically, why it says “all second table cells.” What does “second” mean? This isn`t proper English
ii) what is it looking for exactly when it says td + td? The program is about taking data from a table, so would td + td pick out anything between html table tags <td></td> for example?
//use querySelector to find all second table cells
var cells = document.querySelectorAll("td + td");
It’s looking for only
<td>s which are preceded by another<td>( http://www.w3.org/TR/CSS2/selector.html#adjacent-selectors ).So with this HTML, it would match
<td>s 2-4 (inclusive):An example here: http://jsfiddle.net/tMrbA/