jQuery: How to create a single-click dropdown menu with an href title
<p>I need to make a dropdown menu with the following behavior:</p>

<ul>
<li>Single-click - opens a submenu</li>
<li>Double-click - opens a link</li>
</ul>

<p>Currently, double-clicking the link works but the submenu doesn't open. How can I best create the desired effect considering my below code?</p>

<pre><code>&lt;ul class="menu"&gt;
            &lt;li&gt;&lt;a href="http://www.google.com"&gt;Menu 1&lt;/a&gt;
            &lt;ul class="submenu"&gt;
                &lt;li class="li"&gt;&lt;a href="http://www.google.com"&gt;submenu 1&lt;/a&gt;&lt;/li&gt;
                &lt;li class="li"&gt;&lt;a href="http://www.google.com"&gt;submenu 2&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="http://www.google.com"&gt;Menu 2&lt;/a&gt;
            &lt;ul class="submenu"&gt;
                &lt;li class="li"&gt;&lt;a href="http://www.google.com"&gt;submenu 1&lt;/a&gt;&lt;/li&gt;
                &lt;li class="li"&gt;&lt;a href="http://www.google.com"&gt;submenu 2&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;a href="http://www.google.com"&gt;Menu 3&lt;/a&gt;
                &lt;ul class="submenu"&gt;
                &lt;li class="li"&gt;&lt;a href="http://www.google.com"&gt;submenu 1&lt;/a&gt;&lt;/li&gt;
                &lt;li class="li"&gt;&lt;a href="http://www.google.com"&gt;submenu 2&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
            &lt;/li&gt;
        &lt;/ul

.submenu{
        display: none;
    }

 $(document).ready(function() {
    $('.menu').show();

    $(".menu &gt; li &gt; a").attr("data-count", "0");
    $(".menu &gt; li &gt; a").on("click", function(){

    var clickCount = $(this).attr("data-count");
    clickCount ++;
    if (clickCount == 1) {
      $(this).attr("data-count", clickCount);
      return false
    } else {
      return true;
    }
});
        });
</code></pre>