feld1-andert-werte-in-feld2-coding.php


Quell Code


<p> LeP (derzeit/max)  </p>
 <input class="inputfieldlep" max="1" id="feld1" type="number" name="feld1">  
 <input class="inputfieldlep" type="text"   id="feld2" name="feld2">
<p>
Javascript:In die Zwischenablage kopieren
</p>
<script>



var  max=100;
var feld1=document.getElementById('feld1');
feld1.setAttribute('max',max);
var feld2=document.getElementById('feld2');
feld1.addEventListener('click',function(){
 
  if(feld1.value<=(max/4*1)){
    feld2.value= "Schmerzstufe IV";
  }else
    if(feld1.value<=(max/4*2)){
    feld2.value= "Schmerzstufe III";
  }else
    if(feld1.value<=(max/4*3)){
    feld2.value= "Schmerzstufe II";
  }else
    if(feld1.value<max){
    feld2.value= "Schmerzstufe I";
  }else{
     feld2.value= "100% erreicht";
  }
});
</script>


Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0