Need help with string join

Need help with string join

Hello,


I have this so far,


$(function (){
     var checkIt = $('.myMessage').append( $('.myInputst').map(function (){
         return $(this).val();
   }).get().join(", ") );
   
   $('.myOutput').append(checkIt);
});



which takes the value from 2 form fields and joins them into a string.

Which outputs the following:

4561, 1, 3345, 3, 3300, 1, 444, 2, 5567, 1


Is there any way that I can adjust the code to output a string like this:

4561,1;3345,3;3300,1;444,2;5567,1;





Any help would be much appreciated,
I am stumped.

Michael
    • Topic Participants

    • me