How to control to specify the second button with different id using jQuery?

There are two buttons. I need with Ajax in another button to get the data-id of the other button.

Simply get the parameter in the button so
var name = $(this).data('name');

But how to get parameter from another button?
June 7th 19 at 14:59
1 answer
June 7th 19 at 15:01
It sort of works, but there are some nuances. Tomorrow will tell - Audrey0 commented on June 7th 19 at 15:04
I sit here thinking how it civilno to do. Just one click of the button I have invoked a modal window.

But these buttons can be 50 pieces, and a modal window one just change the settings in it that come Ajax.

Tried to this option is your way it gets in any occurrence of a modal window is always the first parameter knoke - Audrey0 commented on June 7th 19 at 15:07
Although remember , that when you click in the modal window, Ajax comes id this .

In principle it is possible to put an invisible input and assign it to id this parameter from the response, and the second click rip id - Audrey0 commented on June 7th 19 at 15:10
Yes, it works. Although similar on a crutch) But Ajax in Ajax place don't want - Audrey0 commented on June 7th 19 at 15:13

Find more questions by tags jQuery