I am creating an input element dynamically to introduce a title to an image that the user uploads.
When I create the element I assign it as id title + the name of the uploaded image. To remove the spaces and accents that may have the name of the image that is being uploaded, add an encodeURI (nameImage). This returns a string with %
Example: "garden games" - > encodeURI returns jardi%CC%81n%20juegos
The input element is created and displayed on the page correctly with that id.
The problem is when I try to access it when they save the data. I access it by $("#titlejardi%CC%81n%20juegos").val()
to get its value. For the elements that are created without %
because they do not have spaces or accents I am doing well. How can I access the value of the item?