Mat
Mat

Reputation: 6324

javascript array and mysql

        var day = new Array();
     $(':checkbox:checked').each(function(i){
     day.push($(this).val());
      });
       alert(day);

which return this:

enter image description here

but I would like to get this:

`3`,`10`,`16`

thanks

Upvotes: 0

Views: 39

Answers (2)

dimusic
dimusic

Reputation: 4133

day.push('`' + $(this).val() + '`');

Upvotes: 1

CrayonViolent
CrayonViolent

Reputation: 32532

It is in an array. Alerts just show arrays differently. try looking at it in console.log() you will see

Upvotes: 0

Related Questions