jquery set previous inputs to 0
<p>I have a checkbox at the end of 5 inputs and one dropdown. I am trying through jquery to set all the inputs and the dropdown before the checkbox to 0.</p>

<p>There will be many employees listed so it has to be only the ones before the checkbox.</p>

<p>My feeble attempt at the jquery. I have the .on as sometimes it will be called through ajax</p>

<pre><code>$(document).ready(function () {

    $(document).on('click', '.fasCheck', function(){

    if ($(this).attr("checked") == "checked"){
        $(this).prev().parent().prev(".payWeek").next('input').prop('checked', true);;
    } else {

    }
    });     

});
</code></pre>

<p>The html:</p>

<pre><code>&lt;div class="returns" id="employee"&gt;
&lt;h3&gt;David Wilson&lt;/h3&gt;
&lt;div class="payWeek"&gt;
        &lt;label for="MonthlyReturn0PayWeek1"&gt;Pay Week1&lt;/label&gt;
        &lt;input type="number" id="MonthlyReturn0PayWeek1" value="" maxlength="12" step="any" name="data[MonthlyReturn][0][pay_week1]"&gt;
    &lt;/div&gt;
   &lt;div class="payWeek"&gt;
        &lt;label for="MonthlyReturn0PayWeek2"&gt;Pay Week2&lt;/label&gt;
        &lt;input type="number" id="MonthlyReturn0PayWeek2" value="" maxlength="12" step="any" name="data[MonthlyReturn][0][pay_week2]"&gt;
   &lt;/div&gt;
   &lt;div class="payWeek"&gt;
        &lt;label for="MonthlyReturn0PayWeek3"&gt;Pay Week3&lt;/label&gt;
        &lt;input type="number" id="MonthlyReturn0PayWeek3" value="" maxlength="12" step="any" name="data[MonthlyReturn][0][pay_week3]"&gt;
   &lt;/div&gt;
   &lt;div class="payWeek"&gt;
        &lt;label for="MonthlyReturn0PayWeek4"&gt;Pay Week4&lt;/label&gt;
        &lt;input type="number" id="MonthlyReturn0PayWeek4" value="" maxlength="12" step="any" name="data[MonthlyReturn][0][pay_week4]"&gt;
    &lt;/div&gt;
    &lt;div class="payWeek"&gt;
         &lt;label for="MonthlyReturn0PayWeek5"&gt;Pay Week5&lt;/label&gt;
         &lt;input type="number" id="MonthlyReturn0PayWeek5" value="" maxlength="12" step="any" name="data[MonthlyReturn][0][pay_week5]"&gt;
     &lt;/div&gt;
     &lt;div class="payWeek"&gt;
          &lt;label for="MonthlyReturn0PayWeeks"&gt;Pay Weeks&lt;/label&gt;
          &lt;select id="MonthlyReturn0PayWeeks" name="data[MonthlyReturn][0][pay_weeks]"&gt;
                &lt;option value="0"&gt;0&lt;/option&gt;
                &lt;option value="1"&gt;1&lt;/option&gt;
                &lt;option value="2"&gt;2&lt;/option&gt;
                &lt;option value="3"&gt;3&lt;/option&gt;
                &lt;option selected="selected" value="4"&gt;4&lt;/option&gt;
                &lt;option value="5"&gt;5&lt;/option&gt;
           &lt;/select&gt;
      &lt;/div&gt;                        
      &lt;div class="payWeek"&gt;
           &lt;label for="FAS"&gt;FAS&lt;/label&gt;
           &lt;input type="checkbox" class="fasCheck" name="FAS"&gt;
      &lt;/div&gt;
&lt;/div&gt;
</code></pre>
