I have 2 textareas (textarea1 and textarea2). On textarea1 im using an expander. As you type the textarea expands. Now, what ever you type on the textarea1 is written on textarea2 but the second textarea doesn't expand. I am looking something that would get the height from textarea1 as im typing and set it to textarea2. I would image it would be something like:
$("#textarea1").bind("keyup keypress paste mouseup", function() {
$('#textarea1').val().height== ('#textarea2').height??
or
开发者_C百科$("#textarea1").bind("keyup keypress paste mouseup", function() {
$('#textarea2').attr('height', $('#textarea1').val().height);
None of those work.
Thanks alot
$("#textarea1").bind("keyup keypress paste mouseup", function() {
$('#textarea2').css('height', $('#textarea1').height());
$("#textarea2").css("height", $("#textarea1").height() + "px");
That should work.
精彩评论