I need a user to be able to perform these actions:
- Click an “Add” button. This will add a JavaScript object to either an array, or another JavaScript object.
- Click a dynamic “Remove” button. This will remove the JavaScript object from the array, or object, whose ID matches the button click.
- Submit the complete array, or object, of desired objects server-side for processing.
Using an array, am I able to get a handle via ID on a specific element and remove it with a “pop”-like function? If not, am I able to do so using a JavaScript object?
This question is related to this post, but there isn’t much context in the original to answer my question. Thanks!
It may actually be better to use an object rather than an array. This will allow you to name each object you send back to the server.