Reputation: 5168
i looking for a way to preview the text while im typing in a textarea in jquery
exactly what u are using for Stackoverflow ,
Upvotes: 10
Views: 11217
Reputation: 245449
<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>
.
Upvotes: 22