What I'm trying to ask is that when I take on a .each loop in jQuery using a build of a string by this:
$('.list :checkbox').each(function()
{
var type = $(this).attr('value');
Build += type + ', ';
return Build;
});
But now I need to remove the last "," (without quotes) since it makes a list like this:
Item 1, Item 2, Item 3, Item 4, Item 5,
Then it has to be added to the html() function which works well, but when trying to remove the last "," doesn't work by doing this:
Build.substr(-1);
$('#list-box').html(Build);
But that won't work.
this.valueinstead of$(this).attr('value'). It's faster and more readable.