title: Jquery and php select option
body: <p>im trying to do a jquery select option, if the select value it is not equal to three then disable the button, and if it is three, enable it but my problem it is that if i put an option like the commented in my code (Seleccionar Turno-->), it is not taking the changes, how i can improve my code?</p>
  <p>HTML</p>
  <pre><code>&lt;form role=&quot;form&quot; id=&quot;formcaja&quot; name=&quot;formcaja&quot; method=&quot;post&quot; action=&quot;&quot; onsubmit=&quot;return revisadatos()&quot; &gt;
                      &lt;div class=&quot;card-body&quot;&gt;
                          &lt;div class=&quot;form-group&quot;&gt;
                            &lt;label for=&quot;fecha_cierre&quot; class=&quot;control-label col-sm-6&quot;&gt;Fecha de Cierre&lt;/label&gt;
                            &lt;input id=&quot;fecha_cierre&quot; name=&quot;fecha_cierre&quot; type=&quot;text&quot; value=&quot;&lt;?php echo date(&quot;d/m/Y H:i:s&quot;); ?&gt;&quot; class=&quot;form-control&quot; style=&quot; width:350px&quot; readonly=&quot;readonly&quot; &gt;
                            &lt;label for=&quot;turno&quot; class=&quot;control-label col-sm-6&quot;&gt;Caja&lt;/label&gt;
                            &lt;input id=&quot;cajaID&quot; name=&quot;cajaID&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $data3[&quot;id&quot;]; ?&gt;&quot; class=&quot;form-control&quot; style=&quot; width:350px&quot; readonly=&quot;readonly&quot; &gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;form-group&quot;&gt;
                              &lt;label for=&quot;monto_cierre&quot; class=&quot;control-label col-sm-6&quot;&gt;Monto Actual&lt;/label&gt;
                                    &lt;div class=&quot;input-group  mb-3&quot;style=&quot; width: 30%&quot;&gt;
                                        &lt;div class=&quot;input-group-prepend&quot;&gt;
                                          &lt;span class=&quot;input-group-text&quot; id=&quot;inputGroup-sizing-sm&quot;&gt;$&lt;/span&gt;
                                        &lt;/div&gt;
                                        &lt;input name=&quot;monto_cierre&quot; id=&quot;monto_cierre&quot; type=&quot;text&quot; class=&quot;form-control&quot; aria-label=&quot;Small&quot; aria-describedby=&quot;inputGroup-sizing-sm&quot; value=&quot;&lt;?php echo number_format($data[&quot;gtotal&quot;], 2);?&gt;&quot; readonly=&quot;readonly&quot;/&gt;    
                                    &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;form-group&quot;&gt;
                              &lt;label&gt;Turno a Cerrar&lt;/label&gt;
                              &lt;div class=&quot;col-xs-2&quot;&gt;
                                  &lt;select class=&quot;form-control&quot; name=&quot;turnoID&quot; id=&quot;turnoID&quot;&gt;
                                      &lt;!--&lt;option&gt;Seleccionar Turno&lt;/option&gt;--&gt;
                                      &lt;?php
                                      while ($row = mysqli_fetch_array($resb)) {
                                          echo &quot;&lt;option value='&quot;.$row['id'].&quot;'&gt;&quot;.$row['desc_turno'].&quot;&lt;/option&gt;&quot;;
                                      }
                                      ?&gt;
                                  &lt;/select&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;label for=&quot;usuarioID&quot; class=&quot;control-label col-sm-2&quot;&gt;Elaboró&lt;/label&gt;
                                  &lt;div class=&quot;col-sm-4&quot;&gt;
                                      &lt;input name=&quot;usuarioID&quot; id=&quot;usuarioID&quot; type=&quot;text&quot; class=&quot;form-control&quot; placeholder=&quot;Elaboró&quot; value=&quot;&lt;?php echo $_SESSION['username']; ?&gt;&quot; readonly /&gt;
                                  &lt;/div&gt;  
                      &lt;/div&gt;
                      &lt;!-- /.card-body --&gt;
                      &lt;div class=&quot;card-footer&quot;&gt;
                        &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot; value=&quot;turno&quot;&gt;Cerrar Turno&lt;/button&gt;
                        &lt;button type=&quot;submit&quot; class=&quot;btn btn-danger&quot; value=&quot;cierre&quot; id=&quot;cierrecaja&quot;&gt;Cerrar Caja&lt;/button&gt;
                      &lt;/div&gt;
                    &lt;/form&gt;
  </code></pre>
  <p>JS</p>
  <pre><code>$(document).ready(function(){
      var opcion = $(&quot;#turnoID&quot;).val();
      console.log(opcion) //This is for see in the console what it is happening
      if (opcion != &quot;3&quot;) {
          $(&quot;#cierrecaja&quot;).attr('disabled','disabled')
      }
      $(&quot;#turnoID&quot;).change(function () {
          if ($(this).val() != &quot;3&quot;) {
              $(&quot;#cierrecaja&quot;).attr('disabled','disabled')
          } else {
              $(&quot;#cierrecaja&quot;).attr('enabled','enabled')
          }
      });    
  });
  </code></pre>