Currently, I am in the process of developing a project that involves users. In order to display all users, I am executing a query on an SQL database. After styling the interface, I have added an input element beside each user, which initializes at zero. Additionally, there are two buttons - one for incrementing (#up) and another for decrementing (#down) the value displayed in the input element. Essentially, these buttons act as spinners. Moreover, I aim to set limits for the input element, with a minimum value of 5 and a maximum of 500.
Despite my attempts at implementing various 'onclick' functions, I have not been successful. While using 'GetElementById', it only alters the value of the input element for the first user due to the unique ID assigned to it. How can I rectify this issue?
I deeply appreciate any assistance provided. As a beginner, I welcome corrections if I have made any mistakes rather than receiving downvotes.
Below is the HTML code:
<span class='username'>" . $row['username'] . "</span>
<form name='matchcreator' id='amount' action='arena.php' method='post'>
<input name='m-maker' type='text' id='price' maxlength='15' value='0'/>
<button id='up' type='button'><img src='images/up.png' width='10px' height='10px' href='#'></button>
<button id='down' type='button'><img src='images/down.png' width='10px' height='10px' href='#'></button>
</form>