0
Good afternoon, I have a table that has a column with an input radio, I need to read the values of each row of an input radio without interfering in the order of the lines. Example, I have 3 lines and selected only the radio of the last line, I need to return the function the value of the radio button in the third time I read it. I tried to use Document.querySelectorAll('input[type=radio]:checked')[Indice]. value however the problem is that it sorts by selected radio Buttons. Then in the scenario I explained he returned first the radio button selected and then brought Undefined
var table = document.getElementById("tblpergunta");
for (var i = 1, row; row = table.rows[i]; i++)
{
var CheckListRespostaModel = {
"PerguntaId": "", "CheckListPendenteId": "", "Observacao": "", "Controle": "", "Id" :"",
"Nome": "", "BytesToString": "", "Extensao": ""
};
rows = table.getElementsByTagName('tr');
var cells = rows[i].getElementsByTagName('td');
CheckListRespostaModel.PerguntaId = cells[2].innerText;
alert(document.querySelectorAll('input[type=radio]:checked')[i - 1]);
}
in the other two read.