• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

81
Views
J-query function not working for every button

html code

 foreach (DataRow row in dt.Rows)
            {
                sb.Append("<tr>");
                foreach (DataColumn column in dt.Columns)
                {
                    sb.Append("<td>" + row[column.ColumnName].ToString() + "</td>");
                }

                sb.Append("<td style='TEXT-ALIGN: CENTER;'>");
                sb.Append("<a id='cmp' class='btn-edit' href=''>"); sb.Append("<button type='button' id='EditRow' class='btn btn-info btn-xs ' style='margin-right: 10px;'>"); sb.Append("Complete"); sb.Append("</button>"); sb.Append("</a>");
                sb.Append("</td>");
                sb.Append("</tr>");
             }

jquery

 $(function () {
             
                 $('.btn-edit').click(function () {
                     
                     $('#cmp').attr('href', 'AddQuestions.aspx');
    
                 });
    });

[on clicking the complete button another page should open but it only happens when we click the first button on clicking second button the page just reloads][1] [1]: https://i.stack.imgur.com/WxvIV.png

almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error