title: Keep child toggled when clicking in search form - jquery
body: <p>I'm trying to make a sleek responsive header for my website and use jQuery to <code>slideToggle</code> <code>#navSearchDD</code> with a search form inside from the header. The problem I'm experiencing is when I'm clicking in the search field, when it again <code>slideToggles</code> <code>#navSearchDD</code> and hides it again. </p>
  
  <p>I made a JSFiddle displaying the situation:</p>
  
  <p><a href="https://jsfiddle.net/tksengen/yh8wju2q/1/" rel="nofollow">https://jsfiddle.net/tksengen/yh8wju2q/1/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>jQuery(function () {
  
      jQuery("#navMoreButton").click(function () {
          jQuery("#navMoreDD").slideToggle("fast", function () {
              // Animation complete.
          });
      });
  
      jQuery("#navSearchButton").click(function () {
          jQuery("#navSearchDD").slideToggle("fast", function () {
              // Animation complete.
          });
      });
  
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body { 
      padding: 0;
      margin: 0;
  }
  
  ul {
      margin: 0;
      padding: 0;
  }
  
  li {
      margin: 0;
      padding: 0;
  }
  
  .group:after {
    content: "";
    display: table;
    clear: both;
  }
  
  .fs-nav-wrap {
   width: 100%;
   height: 50px;
   background-color: #22222c;
  }
  
  .fs-nav-border {
   height: 48px;
   border-top: 1px solid #333333;
   border-bottom: 1px solid #333333;
      
  }
  
  .fs-nav-wrap header {
   height: 100%;
  }
  
  .fs-nav-search, .fs-nav {
   width: 20%;
   float: left;
  }
  
  .fs-nav-logo {
   width: 60%;
   float: left;
  }
  
  .fs-nav-logo {
   height: 100%;
   text-indent: -9999px;
  }
  
  .nav-logo {
   font-size: 14px;
   color: #F9F9F9;
   margin: 0;
   padding: 0;
   display: block;
   height: 100%;
  }
  
  .nav-logo a {
   height: 100%;
   display: block;
   background-image: url('images/mobile-logo.svg');
   background-repeat: no-repeat;
   background-position: center center;
   background-size: 35px;
   
  }
  
  .fs-nav-search {
   height: 100%;
  }
  
  .fs-nav {
   height: 100%;
   text-align: right;
   
  }
  
  .fs-nav ul,
  .fs-nav-search ul {
   height: 100%;
  }
  
  .fs-nav ul li,
  .fs-nav-search ul li {
   display: inline-block;
   font-weight: 300;
   line-height: 48px;
   margin-right: 10px;
   
  }
  
  .fs-nav .nav-desk {
   display: none;
  }
  
  .fs-nav .nav-more,
  .fs-nav-search ul li {
   margin-right: 0;
   padding: 0 20px;
   border-left: 1px solid #22222c;
   border-right: 1px solid #22222c;
  }
  
  .fs-nav .nav-more:hover,
  .fs-nav-search ul li:hover {
   background-color: #15151c;
   border-left: 1px solid #333333;
   border-right: 1px solid #333333;
   cursor: pointer;
  }
  
  .fs-nav .nav-more img,
  .fs-nav-search ul li img {
   width: 15px;
  }
  
  .fs-nav .nav-more {}
  
  #navSearchDD {
   display: none;
   position: absolute;
   right: 0;
   min-width: 300px;
   width: 100%;
   background-color: #15151c;
   z-index: 5;
   text-align: left;
  }
  
  
  #navSearchDD {
      display: block;
  }
  
  #navSearchDD:after {
   content: "";
   height: 1px;
   width: 55px;
   background-color: #15151c;
   border-left: 1px solid #333;
   border-right: 1px solid #333;
   position: absolute;
   top: 0;
   left: 0;
  }
  
  .navSearchDD-border {
   border: 1px solid #333;
  }
  
  #navSearchDD span.screen-reader-text {
   display: none;
  }
  
  #navSearchDD input {
   background-color: inherit;
   border: none;
   color: #8c8ca4;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="fs-nav-wrap group"&gt;
      &lt;div class="fs-nav-border group"&gt;
          &lt;header&gt;
              &lt;div class="fs-nav-search"&gt;
                  &lt;ul&gt;
                      &lt;li id="navSearchButton"&gt;
                          &lt;img src="http://fsdev.tew.no/wp-content/themes/fifasamfunnetbny/images/nav-search.svg" alt="Søk"&gt;
                          &lt;div id="navSearchDD"&gt;
                              &lt;div class="navSearchDD-border"&gt;
                                  &lt;form role="search" method="get" class="search-form" action=""&gt;
                                      &lt;label&gt; &lt;span class="screen-reader-text"&gt;Søk etter:&lt;/span&gt;
  
                                          &lt;input type="search" class="search-field" placeholder="Søk …" value="" name="s" title="Søk etter:"&gt;
                                      &lt;/label&gt;
                                  &lt;/form&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
              &lt;div class="fs-nav-logo"&gt;
                   &lt;h1 class="nav-logo"&gt;
      &lt;a href="/"&gt;Test - Hjem&lt;/a&gt;
     &lt;/h1&gt;
  
              &lt;/div&gt;
              &lt;div class="fs-nav"&gt;
                  &lt;ul&gt;
                      &lt;li class="nav-desk"&gt;&lt;a href="#"&gt;Test&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li class="nav-desk"&gt;&lt;a href="#"&gt;Test&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li class="nav-desk"&gt;&lt;a href="#"&gt;Test&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li class="nav-desk"&gt;&lt;a href="#"&gt;Test&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li class="nav-more" id="navMoreButton"&gt;
                          &lt;img src="http://fsdev.tew.no/wp-content/themes/fifasamfunnetbny/images/nav-more.svg" alt="Mer"&gt;
                          
                          &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/header&gt;
          &lt;!-- #masthead --&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- .fs-nav-wrap --&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How would I go about keeping <code>#navSearchDD</code> visible as I click in the search form, or is there a better way to achieve what I'm going for here?</p>
  
  <p>Also, I'm not able to get <code>slideToggle</code> to work in jsFiddle if I have <code>display: none;</code> as default for some reason?</p>