title: Jquery Calendar - .attr('id') get wrong value
body: <p>I want to set date in Schedule header by putting <code>div id</code> from Calendar Creation function to Header text.</p>
  
  <p>I get <code>id</code> like this <code>$('.dayNumberCellValue').attr('id');</code>, but I have a problem that when you tap on day in calendar, I get the same date to all days, "27" (this is the startDate of my calendar). It seems to me that in <code>$('.dayNumberCellValue').attr('id');</code>  goes the same date, but why, and how the calendar is working fine if he must show only the "27" date in all cells?</p>
  
  <p>Tap function->></p>
  
  <pre><code>        $('.div-cell').tap(function() {
                              var i;
                              var myDate2;
                                for (i = 0; i &lt; 42; i++) {
                                  $('#' + i + 'dayCell').removeClass('tapped');
  
                                        }
  
                                $(this).toggleClass(
                                     'tapped');
  
                                if($(this).hasClass('tapped')){
  
  
                                      myDate2 = $('.dayNumberCellValue').attr('id');
                                      $('#MSchedule header h4').text("S - "+myDate2);}
  
                      });
  </code></pre>
  
  <p>Calendar creation-></p>
  
  <pre><code>function setCalendar() {
  
      var cTime = new Date();
      var myDate = months[cTime.getMonth()] + " " + cTime.getFullYear();
      var myDate2 = cTime.getDate() + " " + months[cTime.getMonth()];
  
  
      $('#MCalendar header h4').text(myDate);
       $('#MSchedule header h4').text("Schedule  -  " + myDate2)
  
      var monthView = new Array(42);
  
      var firstDayOfMonth = new Date(cTime.getFullYear(), cTime.getMonth(), 1);
  
      while (firstDayOfMonth.getDay() != 1) {
  
          firstDayOfMonth.addDays(-1);
  
      }
  
      var i;
  
      for (i = 0; i &lt; monthView.length; i++) {
  
  
          startDate = new Date(firstDayOfMonth);
  
          monthView[i] = startDate.addDays(i);
  
          }
  
  
  for(var day=0;day&lt;monthView.length;day++){
  
  var needDay=monthView[day].getDate();
  
  var cell = $('#'+day+'dayCell');
  var content = '&lt;div class="dayNumberCellValue" id=' +needDay+ '&gt;'
      + monthView[day].getDate()
              + '&lt;/div&gt;';
          cell.append(content);}
  </code></pre>