Change flow variable value from template node

i have a bunch os input with value='{{flow.abc}}' but i want that when i click a button this {{flow.abc}} turn into another value. there is some way to do this? the page have auto refresh each second and the js is ready

here is a sample of the code

<div id='molde16'>
                    <div  class="pesoCorpo">
                        <label>Peso Corpo Molde16</label><br>
                        <input type="number" name="pesoCorpo" id='mpc16' step="0000.01" min="0" value=''  readonly>
                    </div>
                    <div  class="pesoOmbro">
                        <label>Peso Ombro Molde16</label><br>
                        <input type="number" name="pesoOmbro" id='mpo16' step="0000.01" min="0" value=''  readonly>
                    </div>
                    <div  class="pesoBase">
                        <label>peso Base Molde16</label><br>
                        <input type="number" name="pesoBase" id='mpb16' step="0000.01" min="0" value=''  readonly>

                    </div>
                </div>


<input type="submit" name="" id="" value='retroceder' style="width:200px;" onclick="retroceder()">

var mpc16 = document.getElementById("mpc16")
        var mpo16 = document.getElementById("mpo16")
        var mpb16 = document.getElementById("mpb16")

mpc16.value="{{flow.pesoCorpo_molde16}}"
    mpo16.value="{{flow.pesoOmbro_molde16}}"
    mpb16.value="{{flow.pesoBase_molde16}}"

var mainlist = [mpc1.value, mpo1.value, mpb1.value,
        mpc2.value, mpo2.value, mpb2.value,
        mpc3.value, mpo3.value, mpb3.value,
        mpc4.value, mpo4.value, mpb4.value,
        mpc5.value, mpo5.value, mpb5.value,
        mpc6.value, mpo6.value, mpb6.value,
        mpc7.value, mpo7.value, mpb7.value,
        mpc8.value, mpo8.value, mpb8.value,
        mpc9.value, mpo9.value, mpb9.value,
        mpc10.value, mpo10.value, mpb10.value,
        mpc11.value, mpo11.value, mpb11.value,
        mpc12.value, mpo12.value, mpb12.value,
        mpc13.value, mpo13.value, mpb13.value,
        mpc14.value, mpo14.value, mpb14.value,
        mpc15.value, mpo15.value, mpb15.value,
        mpc16.value, mpo16.value, mpb16.value,]


        var demonho = [mpc1, mpo1, mpb1,
            mpc2, mpo2, mpb2,
            mpc3, mpo3, mpb3,
            mpc4, mpo4, mpb4,
            mpc5, mpo5, mpb5,
            mpc6, mpo6, mpb6,
            mpc7, mpo7, mpb7,
            mpc8, mpo8, mpb8,
            mpc9, mpo9, mpb9,
            mpc10, mpo10, mpb10,
            mpc11, mpo11, mpb11,
            mpc12, mpo12, mpb12,
            mpc13, mpo13, mpb13,
            mpc14, mpo14, mpb14,
            mpc15, mpo15, mpb15,
            mpc16, mpo16, mpb16,
        ]

        var his = []
        for (var i = 0; i < mainlist.length; i++) {
            if (mainlist[i] === '') {
                his.push(i)
                console.log(his)
            }
        }


        // his[0] é o item a ser editado
        function retroceder() {
            console.log(demonho[his[0]-1].value)
            demonho[his[0]-1].value = ""

        }