Returning Data From Function

Returning Data From Function

Hi there,

  I am trying to return the value of a 'data-value' attribute from a list of checkboxes:

HTML:
  1. <div id="disableDays">
  2.                             <div class="field">
  3.                                 <input type="checkbox" id="Sunday" class="is-checkradio" name="Sunday" data-value="0">
  4.                                 <label for="Sunday" class="label">Sunday</label>
  5.                             </div> 
  6. </div>

JQUERY
  1. dayValue = $('#disableDays input:checked').each(function() {
  2.                     return $(this).attr('data-value')
  3.                 });

If I console.log 'dayValue' I get 'input#Sunday.is-checkradio' as opposed to '0'. If I change the attr to 'name' or 'Id' I get the same response. Why I am not getting the attribute value returned here and what do I need to change to achieve this?

Thanks