title: how to close a modal window using a button click
body: <p>I have a modal window but I want to set up a close function so that when the user clicks on the "button", it will close the modal window. Does anyone know how this can be achieved?</p>
  
  <p>I have a link to the application so you can view it <a href="http://helios.hud.ac.uk/u0867587/Mobile_app/QandATable2.php" rel="nofollow">here</a></p>
  
  <p>Below is the javascript code where it shows the function of opening the modal window and the setup function of where I want to place the code to close the modal window:</p>
  
  <pre><code>function plusbutton() {
      $(".previouslink").modal(); 
      return false;
  }
  function closewindow() {    
      return false;
  }
  </code></pre>
  
  <p>Below is the form code where user clicks on the plus button and it displays the content within the "previouslink" div tag:</p>
  
  <pre><code>&lt;form id="QandA" action="imageupload.php" method="post"&gt;
      &lt;h1&gt;CREATING QUESTIONS AND ANSWERS&lt;/h1&gt;
      &lt;table id="plus" align="center"&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;a onclick="return plusbutton();"&gt;
  &lt;image src="Images/plussign.jpg" width="30" height="30" alt="Look Up Previous Question" class="plusimage"/&gt;
              &lt;/a&gt;&lt;span id="plussignmsg"&gt;(Click Plus Sign to look &lt;br /&gt;
              up Previous Questions)&lt;/span&gt; &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;div class="previouslink"&gt;
          &lt;h1&gt;PREVIOUS QUESTIONS&lt;/h1&gt;
          &lt;button type="button" id="close" onclick="return closewindow();"&gt;Close
          &lt;/button&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>