4
The problem is the following php returns me several buttons with a hidden input to identify the button.
$nome = $mysqli->query("SELECT * FROM menbros ORDER BY id");
while ($row = $nome->fetch_assoc()) {
$nome = $row['identifier'];
$i = $row['id'];
<input type='hidden' value='".$i."' id='troca'/>
<button type='button' onclick='troca()'>
}
i need the javascript variable to grab the input value of the q button was clicked.
this way the bottom returns me the first input of the page but as I have several need my variable take the value of the input above the button clicked. var exchange = $("#exchange"). val();
Describe better because you can close. Take a tour to understand better: http://answall.com/tour
– Daniel Omine