1var $log = $('#myTextArea');
2
3function log(text) { //Remember to clear your text variable each iteration
4 $log.empty();
5 $log.append(text);
6}
7
8// Whichever function during which you want to print to the text area:
9//...
10log("Hello world!");
11//...