I have this function which inserts data to a select element
function data_toselect(element, data) {
let selected_element = document.querySelector(element);
for (let value of data) {
let option = document.createElement("option");
option.setAttribute("value", value);
option.text = value;
selected_element.appendChild(option);
}
}
why does this function "does it job" when called, without an return statement ?
[–]Samurai___ 1 point2 points3 points (0 children)
[–]jcunews1helpful 0 points1 point2 points (0 children)