querySelectorAll() with multiple tables

I´m generating dinamic user´s config tables with PHP, and there is a function to match the password for each user, individualy.
When I have one table only, I can use getElementById and the functions works fine. With multiple tables, using querySelectorAll(“.class”) something happens and I don´t know what is going on.
So I made a test.php script and made a test function to see the javascript console output.
I have 3 tables, and the for last one user´s input it appears for all the tables, but it should work for each one table individually, as the user inputs stuff for each one. Here goes the code:
(HTML)

<div class='config_user' >
    <table>     
        <tr><td>Senha: <td><input type='text' class='senha1' oninput='testE()'>
        <tr><td>Confirmar Senha: <td><input type='text' id='senha1'>        
    </table>
    <table>     
        <tr><td>Senha: <td><input type='text' class='senha1' oninput='testE()'>
        <tr><td>Confirmar Senha: <td><input type='text' id='senha2'>        
    </table>
    <table>     
        <tr><td>Senha: <td><input type='text' class='senha1' oninput='testE()'>
        <tr><td>Confirmar Senha: <td><input type='text' id='senha3'>        
    </table>    
</div>

(JS)
function retornaV(x){
    document.getElementById("senha1").value = x;
    document.getElementById("senha2").value = x;
    document.getElementById("senha3").value = x;
}
function testE(){
var teste = window.document.querySelectorAll(".senha1");
   teste.forEach(function(item, index){
       retornaV(item.value);
       console.log(index + " <- index , valor -> " + item.value);
   })
 }

The console.log returns all the inputs just fine, but retornarV() just give me the value of the last table for all tables.
If someone can help, I appreciate.
Roberto Carreira