Is it possible to access the value in the first cell of a HTMLTableRowElement as defined at : http://krook.org/jsdom/HTMLTableRowElement.html
Yes. If your row is in a variable called tr, just access tr.cells[0] and get whatever you want from it.
Old question, but I'd like to answer with something more appropriate that I believe the OP was looking for, based on the response
anSelected[0].cells[0].innerText which works, I'm looking for alternatives
According to MDN,
The cells property (HTMLTableRowElement.cells)
Returns a live HTMLCollection containing the cells in the row. The HTMLCollection is live and is automatically updated when cells are added or removed.
So we can now check MDN for HTMLCollection, take a look at the .item() method, which is described to do exactly what you want:
The method takes an index parameter, which is the position of the Node to be returned.
So, to avoid the following:
anSelected[0].cells[0].innerText
You can use the the .item() method:
anSelected.item(0).cells.item(0).innerText
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With