title: Appended Div not working properly
body: <p>I am developing MVC 3 application and using razor syntax.</p>
  
  <p>In this application I am giving commenting facility.</p>
  
  <p>When user clicks on add comment button it get saved in DB and it also appends in current Div.</p>
  
  <p>Please check image...</p>
  
  <p><em>This is the image before adding new comment...</em></p>
  
  <p><img src="https://i.stack.imgur.com/6mBmE.jpg" alt="enter image description here"> </p>
  
  <p><em>This image is after adding new comment...</em></p>
  
  <p><img src="https://i.stack.imgur.com/XyKhp.jpg" alt="enter image description here"></p>
  
  <p>Now, my problem is when user click on the newly added comment's Delete button I want to show msg - "Delete process start here..." but its now working...</p>
  
  <p>Here is my code...</p>
  
  <pre><code>&lt;script src="../../Scripts/jquery.validate.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  @model  IEnumerable&lt;CRMEntities.Comment&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  
  
  
  //Button which Saves currently added comment in DB as well display on screen...
  &lt;script src="../../Scripts/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $('#AddCommentButton').click(function () 
  
          {     
  
         // alert("clicked");
              $.ajax({
  
                  type: 'post',
                  url: '/Comment/SaveComments',
                  dataType: 'json',
                  data:
                  { 
  
                   'comments' : $('#Comment').val(), 
                   'EType' : @Html.Raw(Json.Encode(ViewBag.EType)), 
                    'EId' : @Html.Raw(Json.Encode(ViewBag.EId))
  
                  },
                  success: function (data) {
  
                      $("p.p12").append('&lt;div style="background-color:#FAFAFA;"&gt;Recently Added... &lt;br /&gt;&lt;a href="@Url.Action("Details", "Employee", new { id = "__id__" })'.replace('__id__', data.OwnerID) + '"&gt;' + data.OwnerName + '&lt;/a&gt;'+ data.cmtDateTime +'&lt;button type="button" id=' + data.Id  + ' class="deleteComment"&gt;Delete&lt;/button&gt;&lt;/span&gt;&lt;br /&gt;' + data.msg + '&lt;/div&gt;')
  
  
                  }
  
              });
          });
      });
  &lt;/script&gt;
  
  
  
  
  &lt;/head&gt;
  &lt;body&gt;
  
  @{
  
  
  
       &lt;div class="ParentBlock"&gt;
  
  
      @foreach (var item in Model)
      {
          &lt;div class="OwnerClass" id="OwnerName"&gt;
  
  
           &lt;span class="EmpName"&gt; @Html.ActionLink(item.Owner.FullName, "Details", "EMployee", new { id = item.OwnerId }, new { @style = "color:#1A6690;" })&lt;/span&gt;
  
             @Html.DisplayFor(ModelItem =&gt; item.CommentDateTime)
  
            &lt;span class="EmpName"&gt;&lt;button type="button" id = "@item.Id" class="deleteComment"&gt;Delete&lt;/button&gt;&lt;/span&gt;
  
  
  
          &lt;p class="CommentP"&gt;
             @Html.DisplayFor(ModelItem =&gt; item.CommentText)
          &lt;/p&gt;
  
  
          &lt;/div&gt;
  
  
      }
  
  
       &lt;p class="p12"&gt;
  
        &lt;/p&gt;
  
  
  
  &lt;/div&gt;
  
        &lt;p id="ClassPara" class="ShowComments" onclick="chkToggle()"&gt;Show All Comments&lt;/p&gt;
  
  }
  
  
  
     @Html.TextArea("Comment", "", 5, 80, "asdsd")
  
  
      &lt;input type="button" value="Add Comment" id="AddCommentButton"/&gt;                         
      &lt;input type="button" value="Clear" onclick="clearText()"/&gt;                    
  
      &lt;br /&gt;
  
  
  
  
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  
  
  
  &lt;script src="../../Scripts/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  
  //   Working code - Deletes the comment from DB and removes hide the current Div
  ////////////////////////////////////////////////////////
  
      $(document).ready(function () {
          $(".deleteComment").click(function ()
           {
              alert("Delete process start here...");
  
           });
      });
  
  
  
  &lt;/script&gt;
  </code></pre>