So I have a table that shows online players in my gameserver and I'm trying to create a button that slaps that player, the script uses the players ID to slap him however my jquery script will only slap the first player in the table.
Any help is very much appreciated, here is my code
function slap(){
var playerid = $("#playerid").val();
$.post("q3/slap.php", { playerid: playerid }, function ( data ) {
// populate data here
});
}
echo "<form><input type='hidden' id='playerid' value='$playerid'><input type=button class='actionbutton' value='Slap' onClick='slap()'></form>";
onClick()handler).$playerid?