jquery .val() += idiom
问题 What's the clearest commonly used idiom for this jQuery snippet? $('#someTextarea').val( $('#someTextarea').val() + someString ); It feels clunky to wrap the original code in a one-line function EDIT: So I can pass a function, which is cool... but my real intentions are for jsfiddles, where I currently do stuff like this: function lazylog (str) { $('#ta').val( $('#ta').val() + str + '\n' ); } // or function lazylogPlain (str) { document.getElementById('ta').value += str + '\n'; } // view