(selectElmt, value, {selected = false, text} = {})
| 18 | * @param {string} [text] - Display text for the option. |
| 19 | */ |
| 20 | const appendOption = function(selectElmt, value, {selected = false, text} = {}) { |
| 21 | if (!text) { |
| 22 | text = value; |
| 23 | } |
| 24 | const optionElmt = document.createElement("option"); |
| 25 | optionElmt.value = value; |
| 26 | optionElmt.selected = selected; |
| 27 | optionElmt.appendChild(document.createTextNode(text)); |
| 28 | selectElmt.appendChild(optionElmt); |
| 29 | }; |
| 30 | |
| 31 | // FHW-defined colors. |
| 32 | const colors = { |
nothing calls this directly
no outgoing calls
no test coverage detected