I have an input like follows:
I\'d like to be able to append a value to th
$('#attachment-uuids').val(function(i,val) { return val + (!val ? '' : ', ') + '66666'; });
EDIT: As @mkoryak noted, I'm doing an unnecessary negation of val in the conditional operator. It could be rewritten without the ! as:
val
!
(val ? ', ' : '')