How select button in JQuery

limorides

New Member
\[code\]<?php foreach ($list as $item): ?> <tr> <td> <div id="<?php echo $item['id']; ?>"> <input type="text" name="name" id="name"/> <button type="submit" id="ajax_submit" value="http://stackoverflow.com/questions/3799228/<?php echo $item['id']; ?>">run</button> </div> </td> </tr><?php endforeach; ?>\[/code\]In this php-code I generate html table. When user click on button they activate this JQuery script\[code\] <script> $(document).ready(function(){ $('button').click(function(){ var id = "#" + $("button").val(); $.post("data/js", { name: $("#name").val(),id : id }, function(data){ $(id).html(data); }); }) }); </script>\[/code\]But, when I want select non-first button in table, script run function for first. Please help to do all normal.PS sorry for my english ;-(
 
Back
Top