Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8319239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:15:40+00:00 2026-06-08T22:15:40+00:00

$(#btnAdd).click(function () { $.ajax({ type: POST, url: View.aspx/AddResponsibility, data: ‘{ClientCode:’ + $(#hfClientCode).val() + ‘,ResponsibilityCode:’

  • 0
  $("#btnAdd").click(function () {
    $.ajax({
      type: "POST",
      url: "View.aspx/AddResponsibility",
      data: '{"ClientCode":"' + $("#hfClientCode").val() + '","ResponsibilityCode":"' + $("#txtResponsibility").val() + '"}',
      async: true,
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (msg) {
        $('#tblRespon > tbody:last').append("<tr><td>" + $("#txtResponsibility").val() + "</td><td>" + $("#txtFullName").val() + "</td><td><a class='delete' id='btnDelete' name='btnDelete' value='" + $("#txtResponsibility").val() + "'>" + "Delete" + "</a></td></tr>");
      },
      error: function (msg) {
        alert(msg.d);
      }
    });
  });

I need to add a class to the ‘< a>’ that is a new element I am adding. The way I’ve attempted above does not appear to be working as the function

$(".delete").click(function () {

does not fire as it does usually with an element already contained on the page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:15:43+00:00Added an answer on June 8, 2026 at 10:15 pm

    You need to use .on() function like this:

    $("#tblRespon").on("click",".delete",function(){
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery code. var destTable = $(#numbers); $(document).ready(function() { $(#btnAdd).click(function() {
I need validate the dynamically appended input text box for the below code $(#btnadd).click(function()
I am using the ajax post method to send values from aspx to php.in
I have a data repeater with each row using a combobox. When you click
I have the following html: <table> <tr> <td> <input type=button id=btnAdd value=Add /> <input
In the example below <html> <head> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js type=text/javascript></script> </head> <body> <a href=#>test</a> <button
I have this js code to add (clone) and delete an element. $('#btnAdd1').click(function (event)
I have a problem retrieving all the data inside the rows added by the
I am trying to use xml documents to store data for a movie database,
Scenario: I have a View and inside that view I also a partial view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.