如何在jquery中输入textarea时显示文本 [英] how to show text while typing in textarea in jquery
本文介绍了如何在jquery中输入textarea时显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种方式来预览文本,同时在jquery中输入textarea
i looking for a way to preview the text while im typing in a textarea in jquery
正是你用于Stackoverflow的内容,
exactly what u are using for Stackoverflow ,
推荐答案
<script>
$(document).ready(function () {
$('#someTextBox').keyup(function(){
$('#target').html($(this).val());
});
});
</script>
<textarea id="someTextBox"></textarea>
<div id="target"></div>
当您在< textarea> $ c $中输入文字c>,文本应复制到
< div>
的HTML中。
As you type text in the <textarea>
, the text should be duplicated in the HTML of the <div>
.
这篇关于如何在jquery中输入textarea时显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文