How to concatenate text with jQuery

I’ve tried various methods but haven’t had any luck as of yet. I’m returning a series of 4 objects via AJAX calls. When each object loads, I’d like to iterate through it (no problem), and populate the “value” attribute of a hidden input field with each value from the object. I can’t seem to find a way to intermingle jQuery and ‘+=’, or find a jQuery substitute.

          jQuery.each(msg, function()
            {
                $('#SomeHiddenInputField').value += this + '|';
            });

At the very least I’d like to be able to set the value of an input field to something, then tack on other delimited values as the AJAX calls return their data.

Any help would be appreciated!


$el = $('#SomeHiddenInputField');
$el.val($el.val() + this + "|");

// or access the dom element directly
$('#SomeHiddenInputField').get(0).value += ...
//or
$('#SomeHiddenInputField')[0].value += ...

//or just use native document.getElementById()

thanks for the quick reply - I did try the val() method, but still found nothing to concatenate other values to it. I’ve tried several variations, but no winners