MCPcopy
hub / github.com/greensock/GSAP / _selectValue

Function _selectValue

esm/GSDevTools.js:288–308  ·  view source on GitHub ↗
(element, value, label, insertIfAbsent)

Source from the content-addressed store, hash-verified

286 }
287},
288 _selectValue = function _selectValue(element, value, label, insertIfAbsent) {
289 var options = element.options,
290 i = options.length,
291 option;
292 value += "";
293
294 while (--i > -1) {
295 if (options[i].innerHTML === value || options[i].value === value) {
296 element.selectedIndex = i;
297 label.innerHTML = options[i].innerHTML;
298 return options[i];
299 }
300 }
301
302 if (insertIfAbsent) {
303 option = _createElement("option", element);
304 option.setAttribute("value", value);
305 option.innerHTML = label.innerHTML = _isString(insertIfAbsent) ? insertIfAbsent : value;
306 element.selectedIndex = options.length - 1;
307 }
308},
309 //increments the selected value of a <select> up or down by a certain amount.
310_shiftSelectedValue = function _shiftSelectedValue(element, amount, label) {
311 var options = element.options,

Callers 2

animationFunction · 0.70
initializeFunction · 0.70

Calls 2

_createElementFunction · 0.70
_isStringFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…