Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

106
Visualizações
Add values From Range object in javascript

i am new to the world of javascript and would love some help. I have a simple quiz with "range" objects in HTML. Each Value is for the range is displayed with

<input type="range" class="form-range" min="0" max="5" id="input1"
oninput="q1points.value = this.value">
<output id="q1points">0</output>

I'm not sure if this way of displaying the values of my range objects is the way to go if i want to count them together.

I have 5 questions. How do i add these values together i javascript and store them in variables?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

function myFunction(){
  var val = document.getElementById('input1').value;
  document.getElementById('res_1').innerHTML = val;
}
<form class="questionForm-1" id="q1" data-question="1">
    <div id="qhead" class="d-flex p-2 bd-highlight text-center">
        <h1>Question 1</h1>
    </div>
    <div id="ondertitel" class="d-flex p-2 bd-highlight text-center">
        <h2>Ik ervaar rust wanneer ik een duidelijke planning heb voor die dag. </h2>
    </div>

    <div class="form-check" id="form-check">
        <div class="d-flex p-4 text-center">
            <label for="customRange2" class="form-label">Example range</label>
            <input type="range" class="form-range" min="0" max="5" id="input1">
        </div>
    </div>
    <p id="res_1"></p>
    <button id="btn-1" type="button" class="btn btn-danger" onclick="myFunction()">Volgende</button>
</form>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda