티스토리 뷰

728x90
반응형
// Create a new option element.
var option = document.createElement("option");

// Set the text and value properties of the option element.
option.text = "Option Text";
option.value = "Option Value";

// Append the option element to the select element.
var select = document.getElementById("mySelect");
select.appendChild(option);

 

728x90
반응형