Broken Internet Explorer feature not working

I have a problem with IE. I created a form with a calculation in JS using an input type range. here's a link to jsfiddle: And html code:

<form action="" method="post" name="checkincome">
<input id="persons" name="persons" type="range" min="1" max="41" value="10" oninput="chckIncome();" />
<p id="personsvalue">10</p>
<br />
<label title="">Sale per person</label>
<input id="starters" name="starters" type="range" value="21.2" min="0.0" max="100.0" step="5" oninput="chckIncome();" />
<p id="startersvalue">21</p>
<br />
<p id="resultsvalue"></p>
<p style="text-align:center; padding-top:10px;">
    <input name="Reset" class="btn btn-large" type="reset" value="Reset" />



function chckIncome() {
var price = 49.9;
var regular = 199.9;
var form = document.forms.checkincome;
var x = parseFloat(form.persons.value);
var y = parseFloat(form.starters.value);
var z = 2.5;
var sum1 = (x * y) * price;
var sum2 = ((x * y) * z) * regular;
var sum3 = ((sum1 + sum2) * 0.25).toFixed(0);
sum3 = sum3.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
document.getElementById('personsvalue').innerHTML = form.persons.value;
document.getElementById('startersvalue').innerHTML = form.starters.value;
document.getElementById('resultsvalue').innerHTML = sum3 + " kr";


It works in all browsers except IE. Can anyone have an idea how to fix this?


source to share

1 answer


not supported in older versions of Internet Explorer. Since it oninput

fires on input, you can use other events to do much the same.

Since you are using range

, I would suggest using onmousemove


<input type="range" id="testInput" onmousemove="test()">

<p id="demo"></p>

   function test() {
      var x = document.getElementById("testInput").value;
      document.getElementById("demo").innerHTML =  x;

Run codeHide result



All Articles