0

I have added and input type button on my form which is inside a <tr> tag and been added dynamically using jquery and I tried various ways for the click event to trigger and it is not supposed to be working. Any help is greatly appreciated.

nothing is working for me

var InertiaField = $('#tr_inertia4');



        $(InertiaField).after('<tr class="tr_CalculateStates">');
        $('.tr_CalculateStates').append('<span class="spanStateClass"><input type="button" id="CalculateStates" class="State1" value="Calculate States" onclick="calculateInertiaStates();" /></span>');

I tried using below options as well,

$(function () {
    $('input[value="Calculate States"]').click(function () {
        alert('working');
    });

});

$(window).on("click", "#CalculateStates", function () {
                    alert('clicked');
                });

 jQuery('.tr_CalculateStates span input').on('click', function (e) {

                   alert('hi');

               });
user38433
  • 123
  • 1
  • 5

2 Answers2

0

$("#Idname").on('click',function(){ );

vijay
  • 176
  • 1
  • 12
0



$(document).ready(function(){
  $("input").select(function(){
    $("input").after(" Text marked!");
  });
  $("button").click(function(){
    $("input").trigger("select");
  });
});

You may missed document.ready in your script