how to show text while typing in textarea in jquery

后端 未结 1 1263
眼角桃花
眼角桃花 2020-12-31 18:15

i looking for a way to preview the text while im typing in a textarea in jquery

exactly what u are using for Stackoverflow ,

相关标签:
1条回答
  • 2020-12-31 19:11
    <script>
      $(document).ready(function () {
        $('#someTextBox').keyup(function(){
          $('#target').html($(this).val());
        });
      });
    </script>
    
    <textarea id="someTextBox"></textarea>
    <div id="target"></div>
    

    As you type text in the <textarea>, the text should be duplicated in the HTML of the <div>.

    0 讨论(0)
提交回复
热议问题