title: Can we use selectors as cases in JQuery?
body: <p>I need to create a function with switch inside which will use cases. As cases I'll have <code>'#a li' '#b li' '#c li' '#d li'</code>
  If #a/b/c/d li clicked, it will check screen width (for responsiveness), and if it is less than 990 it will show modal #amodal #bmodal and etc, depends on which # is clicked.
  How to turn it into one function with switch and cases?</p>
  <p><strong>Jquery:</strong></p>
  <pre><code>   $('#a li').click(function(){
      if ($(window).width() &lt; 990) {
      $('#amodal').modal('show');
      }
  });
  $('#b li').click(function(){
      if ($(window).width() &lt; 990) {
      $('#bmodal').modal('show');
      }
  });
  $('#c li').click(function(){
      if ($(window).width() &lt; 990) {
      $('#cmodal').modal('show');
      }
  });
  $('#d li').click(function(){
      if ($(window).width() &lt; 990) {
      $('#dmodal').modal('show');
      }
  });
  </code></pre>