0
I made this code here:
<div class="snippet">
<p>Habilidades:</p>
<div>
<label for="Passe">Passe</label>
</div>
<input type="range" id="start" name="Passe" min="0" max="11">
<div>
<label for="Drible">Drible</label>
</div>
<input type="range" id="Drible" name="Drible" min="0" max="100" value="90" step="10">
<div>
<label for="Marcação">Marcação</label>
</div>
<input type="range" id="Marcação" name="Marcação" min="0" max="100" value="90" step="10">
<div>
<label for="Finalização">Finalização</label>
</div>
<input type="range" id="Finalização" name="Finalização" min="0" max="100" value="90" step="10">
<div>
<label for="Cabeceio">Cabeceio</label>
</div>
<input type="range" id="Cabeceio" name="Cabeceio" min="0" max="100" value="90" step="10">
<div>
<label for="Cruzamento">Cruzamento</label>
</div>
<input type="range" id="Cruzamento" name="Cruzamento" min="0" max="100" value="90" step="10">
<div>
<label for="Bola Parada">Bola Parada</label>
</div>
<input type="range" id="Bola Parada" name="Bola Parada" min="0" max="100" value="90" step="10">
<div>
<label for="Domínio">Domínio</label>
</div>
<input type="range" id="Domínio" name="Domínio" min="0" max="100" value="90" step="10">
<div>
<label for="Condução">Condução</label>
</div>
<input type="range" id="Condução" name="Condução" min="0" max="100" value="90" step="10">
<div>
<label for="Força">Força</label>
</div>
<input type="range" id="Força" name="Força" min="0" max="100" value="90" step="10">
<div>
<label for="Resistência">Resistência</label>
</div>
<input type="range" id="Resistência" name="Resistência" min="0" max="100" value="90" step="10">
<div>
<label for="Velocidade">Velocidade</label>
</div>
<input type="range" id="Velocidade" name="Velocidade" min="0" max="100" value="90" step="10">
<div>
<label for="Explosão">Explosão</label>
</div>
<input type="range" id="Explosão" name="Explosão" min="0" max="100" value="90" step="10">
<div>
<label for="Posicionamento">Posicionamento</label>
</div>
<input type="range" id="Posicionamento" name="Posicionamento" min="0" max="100" value="90" step="10">
<div>
<label for="Liderança">Liderança</label>
</div>
<input type="range" id="Liderança" name="Liderança" min="0" max="100" value="90" step="10">
<div>
<label for="Espírito de Equipe">Espírito de Equipe</label>
</div>
<input type="range" id="Espírito de Equipe" name="Espírito de Equipe" min="0" max="100" value="90" step="10">
</div>
and wanted to know how do I distribute points, wanted to give the client 80 points that would be distributed between these categories
Just use Javascript, add the current quantities to the additional 80 and set the result as the maximum of the sum of the distributed attributes. In your example it starts with 1356 points already distributed, adding up the 80 points it will have available 1436 points, so you allow it to do the distribution while the sum does not pass this value. Want to try?
– Woss
If the label and input are connected it is better they stay within the same div
– Vinicius Fernandes
@Viniciusfernandes Why?
– Woss
@Andersoncarloswoss in this code is no big deal, but it’s always good to keep the semantics and structuring form of html, and in the future it facilitates styling with css or even if you want to use a bootstrap
– Vinicius Fernandes
@Viniciusfernandes I will have to disagree. I don’t see how that hurts the semantics and leaving them apart is maybe just to facilitate stylization today. But since that’s not part of the scope of the question, if you want to talk some more chat.
– Woss
@Andersoncarloswoss opa, how would I do that friend? can help me?
– Matheus Abreu
Your code has errors also: a
id
cannot have spaces. Another thing, try to use simple id’s without accents. For example, instead ofid="Marcação"
, useid="marcacao"
. In the case ofid="Espírito de Equipe"
, could useid="espirito_de_equipe"
, orid="EspiritoDeEquipe"
, orid="espiritodeequipe"
.. remembering that CSS and Javascript are case sensitive (differentiate between upper and lower case). Obs.: Thename
the same thing.– Sam
thanks I’m new in the business, I’m using javascript to make the limitation
– Matheus Abreu