title: Jquery event.preventDefault() not working
body: <p>I want my menu to show and hide list items on click by default they are hide. The problem is my menu is generated in admin section so it auto assigns url of website to it if i set URL field of particular link to null in menu options. so when i click it reloads home page.</p>
  
  <p>What i want is that when i click any parent li it should stop generating default event so used prevent default. but in my case it is not working and it reloads the page after showing list items of there parent.</p>
  
  <p>Here is a fiddle
  <a href="http://jsfiddle.net/h1b3eb4p/" rel="nofollow">Fiddle</a></p>
  
  <p>Html</p>
  
  <pre><code>&lt;div class="mega-col col-xs-12 col-sm-12 col-md-4" data-type="menu"&gt;
      &lt;div class="mega-col-inner"&gt;
          &lt;ul&gt;
              &lt;li class="parent dropdown-submenu mega-group"&gt;&lt;a class="dropdown-toggle" data-toggle="dropdown" href=""&gt;&lt;span class="menu-title"&gt;Massachusetts Stores&lt;/span&gt;&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                  &lt;div class="dropdown-mega level2"&gt;
                      &lt;div class="dropdown-menu-inner"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-sm-12 mega-col" data-colwidth="12" data-type="menu"&gt;
                                  &lt;div class="mega-col-inner"&gt;
                                      &lt;ul&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=24"&gt;&lt;span class="menu-title"&gt;Burlington Mall, MA&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=25"&gt;&lt;span class="menu-title"&gt;Burlington Mall, MA - Cart&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                      &lt;/ul&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
              &lt;li class="parent dropdown-submenu mega-group"&gt;&lt;a class="dropdown-toggle" data-toggle="dropdown" href=""&gt;&lt;span class="menu-title"&gt;New Jersey Stores&lt;/span&gt;&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                  &lt;div class="dropdown-mega level2"&gt;
                      &lt;div class="dropdown-menu-inner"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-sm-12 mega-col" data-colwidth="12" data-type="menu"&gt;
                                  &lt;div class="mega-col-inner"&gt;
                                      &lt;ul&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=26"&gt;&lt;span class="menu-title"&gt;Brunswick Square Mall, NJ&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=30"&gt;&lt;span class="menu-title"&gt;Garden State Plaza, NJ&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=27"&gt;&lt;span class="menu-title"&gt;Menlo Park Mall, NJ&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=29"&gt;&lt;span class="menu-title"&gt;Ocean County Mall, NJ&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li class=" "&gt;&lt;a href=""&gt;&lt;span class="menu-title"&gt;Rockaway Townsquare, NJ&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                      &lt;/ul&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
              &lt;li class="parent dropdown-submenu mega-group"&gt;&lt;a class="dropdown-toggle" data-toggle="dropdown" href=""&gt;&lt;span class="menu-title"&gt;New York Stores&lt;/span&gt;&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                  &lt;div class="dropdown-mega level2"&gt;
                      &lt;div class="dropdown-menu-inner"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-sm-12 mega-col" data-colwidth="12" data-type="menu"&gt;
                                  &lt;div class="mega-col-inner"&gt;
                                      &lt;ul&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=31"&gt;&lt;span class="menu-title"&gt;Galleria at White Plains, NY&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=42"&gt;&lt;span class="menu-title"&gt;Manhattan, NY-Toys 'R' Us &lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                      &lt;/ul&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
              &lt;li class="parent dropdown-submenu mega-group"&gt;&lt;a class="dropdown-toggle" data-toggle="dropdown" href=""&gt;&lt;span class="menu-title"&gt;North Carolina Stores&lt;/span&gt;&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                  &lt;div class="dropdown-mega level2"&gt;
                      &lt;div class="dropdown-menu-inner"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-sm-12 mega-col" data-colwidth="12" data-type="menu"&gt;
                                  &lt;div class="mega-col-inner"&gt;
                                      &lt;ul&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=32"&gt;&lt;span class="menu-title"&gt;CrabTree Valley, NC&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                          &lt;li class=" "&gt;&lt;a href="index.php?route=common/location_details&amp;amp;loc_id=2"&gt;&lt;span class="menu-title"&gt;Fayetteville, NC&lt;/span&gt;&lt;/a&gt;
                                          &lt;/li&gt;
                                      &lt;/ul&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>  $("#li_menu169 li.parent.dropdown-submenu.mega-group").click(function(event) {
      var id = $(this).prop('id');
      if (id == 'yes') {
  
          //i want to prevent
      } else {
          event.preventDefault();
          $(this).children('.dropdown-mega.level2').show();
          $(this).children('.dropdown-mega.level2').hide();
          //redirect
      }
  });
  
  Css
  
  li.parent.dropdown-submenu.mega-group .dropdown-mega.level2 {
  display: none;
  }
  li
   {
  padding:10px;
  position: relative;
  margin:auto;
  }
  </code></pre>