Why do spaces appear in my string?
<p>I have this function below which returns all IDs of checked boxes on my page seperated by a comma. It works great but the problem is, it seems to put a lot of white space after each checkbox ID. I can't seem to figure out why?</p>

<pre><code>/*Returns selected checkbox ID in string seperated by comma */
function get_selected_chkbox(){

    var checked_string = '';

     $('#report_table').find("input[type='checkbox']").each(function(){

        if(this.checked){

            checked_string = checked_string + this.id + ',';

        }

    });

            alert(checked_string);//test1         ,test2            ,   

    return checked_string;
}
</code></pre>

<p>Thanks all for any help</p>
