Input and Value



  • When entering the field input, I get what I wrote down. It is necessary that the VALUE value appear before the introduction, and a new text emerges after INPUT editing. Can you tell me how to do this?

    <input type="text" class="mytext" value="Пример">
    <p id="contenInput"></p>
    <script>
    $(document).ready ( function(){
    $(".mytext").keyup(function() {
     $('#contenInput').text($(".mytext").val());
    });
    });
    </script> 
    


  • $(document).ready ( function(){
      $(".mytext").bind("change keyup input", function() {
        $('#contenInput').text($(".mytext").val());
      });
      $('#contenInput').text($(".mytext").val());
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <input type="text" class="mytext" value="Пример">
    <p id="contenInput"></p>    




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2