Finding which button is pressed inside a table using jQuery -


I want to know which buttons are pressed inside a form ... The only thing is that these buttons Within the table, I tried many solutions posted in similar questions but they are not working. I have something like this:

  & lt; Form & gt; & Lt; Table & gt; & Lt; Tr & gt; & Lt; Td> & Lt; Button value = ID> Dosomething & lt; / Button & gt; & Lt; TD & gt; & Lt; / Tr & gt; & Lt; / Table & gt; & Lt; / Form & gt;   

I used the code here:. But does not it seem to work any thoughts?

use a method

  $ (this) .attr ('Id'))   

In your event handler:

  $ ('input [type = submit]'). Click (save function () {// form data as data. Data warning ('I' + $ (this) .attr ('id')); $ (this) .Parent () .data ('submitbutton ', $ (This));});  

Note that you do not have data-submitbutton in your bedel , So the .data ('submitbutton') will not return anything.

The fact that the buttons are in the table does not make any difference.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -