detect when a textarea value changes using javascript - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

detect when a textarea value changes using javascript

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <textarea id="yyyy" onkeyup="check(this.value)"></textarea> 
      <textarea id="xxxx" onchange="check2(this.value)" readonly></textarea> 
      <script>
function check(value){/*  w  w w . j  av a 2  s .  c  om*/
    document.getElementById("xxxx").value = value;
    check2(value);
}
function check2(value){
    console.log(value);
}

      </script>  
   </body>
</html>

Related Tutorials