I'm wondering how can I get the value of an input in a specific table cell using javascript?
<td><input type="text"/></td>
I assume getting the innerHTML of a specific cell is quite simple, for example:
var x = document.getElementById("tabela").rows[2].cells[3].innerHTML
but this gives me just the input without it's value. Adding .value to the end of the line doesn't work. I would appreciate your help!
classoridattribute to your input field?var x = document.getElementById("tabela").rows[2].cells[3].getElementsByTagName('input')[0].valueinnerHTMLwould give you the input tag. But to actually get its value, you need to access, the tag itself - there are answers on this page that show how to do that. Getting the HTML for it is not useful, as you are better of getting the DOM node and manipulate that.