Possible Duplicate:
How to change the number of rows in the textarea using jQuery
I'm trying to build a comment box that simulates Facebook, where Shift+Enter increases the rows in the textarea while Enter submits the form. I already can capture both events correctly, I'm just wondering if Javascript alone can edit a page's element attributes since it has already been loaded, or if there's another way to do it.
EDIT:
My code block looks like this:
$(this).keypress(function(e) {
if (e.which == 13 && e.shiftKey) {
this.rows++;
e.preventDefault();
};
});
But this still doesn't seem to work. Again, I've tried placing alerts into this code block so I'm certain the Shift+Enter event is captured, but the textarea's rows just doesn't increase. Any ideas why? :/