How to pass a value
How to pass a value
Hi
- var Id;
- $('.btn.btn-danger').on('click', function () {
- var Id = $(this).data('id');
- // Here Id value is correct and i want to pass this value below click function
- });
-
- $("#deleteConfirmModal").on('click', "#deleteConfirm", function () {
- Id = Id;
- // Here it is showing undefined
- $.ajax({
- url: '/test/Delete',
- data: { 'id': Id },
- type: 'POST',
- dataType: 'json',
- //data: xsrf,
- //cache: false,
- success: function (result) {
-
- }
- }
- });
- return false;
- });