Jquery showing listing

1

How do I keep the filled-in values fixed? every time I change the fields it changes simultaneously.

And another, how do I present the values separately? I ended up concatenating only to show the values: P

Thanks!

carrega_info.js

$(document).click(function capturar()
    {
        var c1 = document.getElementById("criterio").options[document.getElementById("criterio").selectedIndex].text
        var c2 = document.getElementById("gravidade").options[document.getElementById("gravidade").selectedIndex].text
        var c3 = document.getElementById("obs").value;

        document.getElementById("resultado").innerHTML = c1+c2+c3;

    });

test.html

</head>
    <body>
      <form id="iniciar">
          <form>
          <fieldset>
          <legend><span class="number">1</span> blablabla</legend>
            <label for="crit">Selecione o critério:</label>
            <select id="criterio" name="field4">
            <optgroup label="opçoes">
              <option value="crit1">1</option>
              <option value="crit2">2</option>
            </optgroup>
            </select>

            <label for="grav">Gravidade:</label>
            <select id="gravidade" name="field4">
            <optgroup label="selecionee">
              <option value="crit1">1</option>
              <option value="crit2">2</option>
            </optgroup>
            </select>

            <legend> Observação / Solução </legend>
            <textarea id="obs" name="field3" placeholder="adicione algum 
            comentario">
            </textarea>
            </fieldset>

            <input id="res1" class="res" type="button" 
            onload="capturar('carrega_info')" value="Adicionar marcador na 
            página">

            <ul><li id="resultado"> Erros encontrados:</li></ul>
    </body>
</html>
    
asked by anonymous 03.04.2017 / 22:34

0 answers