Two text areas have the same text formatting. Their IDs are textareaA
and textareaB
.
I've successfully added functionality to resize textareaA on keyup. How can I make textareaB
resize its WIDTH while the user is typing in textareaA
?
Here's what I attempted, but it didn't work.
$(document).on("click blur keyup", ".fT", function() { // keyup event for textareaA
var newWidth = $("#textareaA").val(); // this line does not achieve the desired effect
$("#textareaB").width(newWidth);
});