Right now I have multiple rows from mysql printing off the following in php:
while($row=mysql_fetch_array($result)){
echo "<input id='dd".$row["id"]."' onclick='myFunctions()' type='button' value='".$row["id"]."'></form>";}
I am able to retrieve only the most recent value of button dd.
function myFunctions() {
var name = document.getElementById("dd").value;
There are multiple rows though, so how can I get the value of the specific one that was clicked?
This is what the html looks like:
<input id="dd4199" onclick="myFunctions()" value="4199" type="button">
<input id="dd4198" onclick="myFunctions()" value="4198" type="button">
<input id="dd4197" onclick="myFunctions()" value="4197" type="button">
<input id="dd4196" onclick="myFunctions()" value="4196" type="button">
As you can see when it does getElementById it always finds the 4199 because it is the most recent. How can the respective click be found. Thanks!