2
I have the following Ajax snippet to feed text or select input with already defined values:
ids.forEach(function (id) {
document.getElementById(id).value = dados[id];
});
I wonder if you have how to create a new option for a field of type select I set, using the result of Ajax. For example: In HTML I have declared select with no option, it would only be created from the result of this Ajax. It is possible?
Yes, use Foreach or Each in conjunction with Append.
– Diego Souza
Could you give me an example of how to use append?
– Diego
Okay, withdrawal quote.
– Diego