title: Call a function when any anchor tag inside a div is clicked
body: <p>I have a menu like</p>
  
  <pre><code>&lt;div class="nav_bar" style="background: url(../images/nav.jpg) repeat scroll 0px 0px transparent;"&gt;
              &lt;div id="navID" class="ddsmoothmenu"&gt;
                  &lt;ul id='Ul2'&gt;
                              &lt;li id='Li6'&gt;&lt;a href="inner.php" title="Home"&gt;Home &lt;/a&gt;  
                              &lt;/li&gt;
                    &lt;/ul&gt;
                 &lt;ul id='Ul4' &gt;
                 &lt;li id='Li1' &gt;&lt;a href="#" title="Master"&gt;Car &lt;/a&gt;    
                  &lt;ul&gt;
                      &lt;li id='Li10'&gt;&lt;a href="#" title="Plan Type"&gt;Fuel&lt;/a&gt;
                      &lt;ul&gt;                                  
                          &lt;li id='Li10' &gt;&lt;a href="Petrol.php" title="Petrol"&gt;Petrol  &lt;/a&gt; &lt;/li&gt;
                          &lt;li id='Li10' &gt;&lt;a href="Diesel.php" title="Diesel"&gt;Diesel  &lt;/a&gt;&lt;/li&gt;                                   &lt;/li&gt;
                      &lt;/ul&gt;
                      &lt;/li&gt;
                   &lt;/ul&gt;
                    &lt;/li&gt;
  
                &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Is it possible to call a event or a function for click in any anchor tag within the div nav_bar?
  I have tried </p>
  
  <pre><code>$(".nav_bar #navID").click(function(e) {
      alert("hai");
       });  
  </code></pre>
  
  <p>but it doesn't work</p>
  
  <p>Thanks in advance</p>