Assign one text box to second text box with key press event on both text box using jquery? -


i have 2 text box box.now want 1 text on key press event value enter value automatically write in second text box key press event.so want key press event got second text box.so how can don't know.

here text box :

<input type="search" id="search" class="form-control" placeholder="search..."> 

this script code :

 <script type="text/javascript"> $(function () {     $("#search").keypress(function () {         debugger;         //$("#anothername").val($(this).val());                        $(".fixed-table-container").find(".datatables_filter input.input-sm[type='search']").val($(this).val()); // want text box key press event    // 2nd text box            }); }) </script> 

so here write first text box key press event working want same time 2nd text box key press want.

for example write abc on 1st textbox same time keypress using abc write automatically in 2nd textbox time want keypress event 2nd textbox.

how this, using class - type in either replicate in both:

$('.text__input').on('input', function() {    $('.text__input').val($(this).val())  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <input type="text" class="text__input">  <input type="text" class="text__input">


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -