var $log = $('#myTextArea'); function log(text) { $log.append(text); } // Call log() in your button click event or whichever function // you want to use to print to the text area: //... log("Hello world!"); //...