title: event delegation not working with @Html.RenderAction
body: <p>I am rendering a page using @Html.RenderAction and I would like to update the page using <code>$.ajax()</code>, however when I try to do this, the click event is not recognized if I use the below code</p>
  
  <pre><code>$(document).on('click', '.saleType &gt; a', function () {
      var saleType = $(this).text();
      alert(saleType)
      //ajax request made
  }); 
  </code></pre>
  
  <p>but the click event is recognised if I use</p>
  
  <pre><code>$('.saleType &gt; a').click(function () {
      var saleType = $(this).text();
      alert(saleType)
      //ajax request made
  })
  </code></pre>
  
  <p>using the second block of code is not an answer as only the first click is recognised and all subsequent clicks are not recognised.</p>
  
  <p>Why is my first block of code not working?</p>
  
  <p>EDIT:
  Thanks to @shyju I can see the code works in isolation, so my question is how do I debug this problem?</p>