title: jquery Switch Case
body: <p>Here you can find my jQuery-code :</p>
  
  <pre><code>function ledgerSave(){
              var option = $('#ledgerType').val();
              var ledger = $('#ledgerName').val();
  
              switch( option ) {
                  case ( option == 0 ) :
                      alert( 'Select Your Ledger Type' );
                      break;
  
                  case ( option == 1 ) :
                      /* some code */
                  break;
  
                  case ( option == 2 ) :
                      /* some code */
                  break;
  
                  case ( option == 3 ) :
                      /* some code */
                  break;
              }
          }
  </code></pre>
  
  <p>In the variable "option" I'm getting the select values as 0,1,2 and 3.
  so I do the alert when the variable option has a value 0 in it, but it shows no alert. I don't understand where the actual problem is. need help !</p>
  
  <p>I also tried this :</p>
  
  <pre><code>function ledgerSave(){
              var option = $('#ledgerType').val();
              var ledger = $('#ledgerName').val();
  
              switch( option ) {
                  case 0:
                      alert( 'Select Your Ledger Type' );
                      break;
  
                  case 1:
                      /* some code */
                  break;
  
                  case 2:
                      /* some code */
                  break;
  
                  case 3:
                      /* some code */
                  break;
              }
          }
  </code></pre>
  
  <p>but no good.</p>