1 回答
TA贡献1807条经验 获得超9个赞
您正在调用输入文本的侦听器
var p= document.getElementById('pret');//input-text
var vp = document.getElementById('val_pret');//input-range
vp.value = p.value;
p.addEventListener('input', function(){ //here is your error
vp.value = p.value;
}, false);
您应该为输入范围调用侦听器,这是修改后的代码
var i= document.getElementById('RVN');
var o = document.getElementById('revenue');
o.value = i.value;
i.addEventListener('input', function(){
o.value = i.value;
}, false);
var p= document.getElementById('val_pret');// input-range
var vp = document.getElementById('pret');// input-text
vp.value = p.value;
p.addEventListener('input', function(){//solution
vp.value = p.value;
}, false);
var m= document.getElementById('val_mensualite');
var vm = document.getElementById('mensualite');
vm.value = m.value;
m.addEventListener('input', function(){
vm.value = m.value;
}, false);
添加回答
举报