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');
});