0
function SpaceFunction() {
  var x = document.getElementById("removespace");
  x.value = x.value.replace(/ /g, "");
}

and :

function Count() {  
    var i = document.getElementById("mylabel").value.length;  
    document.getElementById("display").innerHTML = 150 - i; 
}

why does not work on mobile devices? and What should I do?

1 Answers1

1

Some mobile and virtual keyboards do not fire keypress events and use the compositionupdate event. I had this problem before and just had to add a listener for both keyup and compositonupdate

Tom
  • 159
  • 14