Tuesday, August 9, 2016

Addevent listener in Angular Js


    Name:<input id="txtname" type="text"/>
    Welcome!

    <script>
      var txtipt = document.getElementById('txtname');

      txtipt.addEventListener('keyup', function(){
        var text = txtipt.value;
        console.log('New text is "' + text + '"');
      });
    </script>

No comments:

Post a Comment