Handle textarea input event with oninput - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea


Handle textarea input event with oninput

Demo Code

ResultView the demo in separate window

      <title>input event</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
 function foo(newValue) {//  w w  w .j a va 2  s. co  m
       document.getElementById("#parsedEditor").innerText = bar(newValue);
 function bar(text) {
     return text.replace(" ", "x");

      <textarea id="#editor" oninput="foo(event.currentTarget.value)"></textarea> 
      <p id="#parsedEditor"></p>  

Related Tutorials