title: How to check which bootstrap modal is open
body: <p>I have this code which is checking to see if a modal is open on the page.
  If a bootstrap is open i need to be able to get the name of it.</p>
  
  <pre><code>        $(document).keypress(function (e) {
          if (e.which == 13) {
  
              var tf = $('div.modal').hasClass('in');
  
              if (tf == true)
              {
  
              }
              else
              {
                  $('#search').click();
              }
  
          }
      });
  </code></pre>
  
  <p>If you could provide with code that generates the ID of the currently open modal that would be great.</p>
  
  <p>Cheers</p>