Skip to content
Advertisement

Jquery how to pass value id from one event handler to another

I have an add-row button. On its click I am adding a row into my datatable.

JavaScript

In the above code, I am using data-id and adding row id to it. On my edit button click I am getting the data-id value.

JavaScript

The above code takes input data from modal. In my modal I have a save button having id btnsubmit. Now on this button click, I want to pass my data-id.

JavaScript

How can I pass the value of data-id in it? Any help would be highly appreciated.

Advertisement

Answer

you could stock your data in html modal like this:

JavaScript

and use:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement