I have a textarea. I need to update text in a div when a value in textarea is changed by either typing in it or by placing some value in it via another jQuery function or pasted.
$(document).ready(function(){
function myFunc() {
var input = $("#myTxt").val();
$("#txtHere").text(input);
}
myFunc();
// EDIT BELOW -- this will update while typing
$("#myTxt").keyup(myFunc);
});
<textarea id="myTxt"></textarea>
<div id="txtHere"></div>
It loads the value on page load but I'm not sure what to use to check for value in the textarea...