Returns a function that gets the value of a selected element.

@return a function that gets the value of a selected element.
338625
public static <E> OptionalFunction<Selection<Element>, E> getValue() {
    return OptionalFunction.of(selection -> selection.result().getValue());
  }
1311440
function () {
            var elem = this[0];
            // No argument, return index in parent
            if (!elem) {
                return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
            }

            // Index in selector
            if (typeof elem === 'string') {
                return indexOf.call(vQ(elem), this[0]);
            }

            // Locate the position of the desired element
            return indexOf.call(this,

                // If it receives a vQ object, the first element is used
                elem.constructor == vQ ? elem[0] : elem
            );
        }
299246
public <V> V getValue() {
        if (values == null || values.isEmpty()) {
            return null;
        }
        return (V)values.get(0);
    }
209369
public boolean somethingSelected() {
        boolean isSelected = false;
        if (input()) {
            WebElement webElement = element.getWebElement();
            if ("input".equalsIgnoreCase(webElement.getTagName())) {
                isSelected = webElement.isSelected();
            } else if (SELECT.equalsIgnoreCase(webElement.getTagName())) {
                Select dropdown = new Select(webElement);
                isSelected = !dropdown.getAllSelectedOptions().isEmpty();
            }
        }
        return isSelected;
    }
512957
@Override
    public String getSelectedOption() throws WidgetException {
        Object value = getValue();
        if (value != null) {
            if (value instanceof String) {
                return (String) value;
            } else {
                throw new WidgetException("More than one option selected", getByLocator());
            }
        } else {
            return null;
        }
    }
742411
public static <T> Function<Optional<T>, T> getFunction() {
    return new Function<Optional<T>, T>() {
      @Override
      public T apply(final Optional<T> input) {
        return input.get();
      }
    };
  }
877356
public String selectedOption() {
        if (isNotPresentSelect()) {
            return null;
        }
        WebElement webElement = element.getWebElement();
        Select dropdown = new Select(webElement);
        WebElement option = dropdown.getFirstSelectedOption();
        return option.getText();
    }
1374838
function() {
    var e = this._element;
    if (!e) return null;
    if (typeof e.getBoundingClientRect !== 'function') {
      console.error("[wdg.rect] This element has non `getBoundingClientRect` function:", e);
    }
    var r = e.getBoundingClientRect();
    if( typeof r.width === 'undefined' ) r.width = r.right - r.left;
    if( typeof r.height === 'undefined' ) r.height = r.bottom - r.top;
    return r;
  }
1009943
function getSelectValues (select, selectedOptions) {
    var value = [],
        options = selectedOptions || select.selectedOptions,
        opt;

    for (var i = 0, len = options.length; i < len; i++) {
      opt = options[i];

      if (!(opt.disabled || opt.parentNode.tagName === 'OPTGROUP' && opt.parentNode.disabled)) {
        value.push(opt.value || opt.text);
      }
    }

    if (!select.multiple) {
      return !value.length ? null : value[0];
    }

    return value;
  }
1188225
private Object getPreviousElement() {
        Object element = null;
        while (currentIndex >= startIndex && element == null) {
            currentIndex--;
            element = getElement();
        }
        return element;
    }
478598
public String getSelectedValue(final By by) {

		Select select = new Select(driver.findElement(by));
		String defaultSelectedValue = select.getFirstSelectedOption().getText();
		return defaultSelectedValue;

	}
149025
public Object getValue()
    {
        if ( value == Special.NULL_VALUE )
            return null;
        if ( value == Special.VOID_TYPE )
                throw new InterpreterError("attempt to unwrap void type");
        return value;
    }
239704
public function getValue()
    {
        $options = $this->options();

        if ($this->multiSelected()) {
            $values = array();

            foreach ($this->selected() as $val) {
                $values[] = $options[$val];
            }

            return $values;
        } else {
            return $options[$this->selected()];
        }
    }
1057127
@SuppressWarnings("unchecked")
  @Override public E get() {
    if (getPreferences().contains(getKey())) {
      return (E) enumValues[getPreferences().getInt(getKey(), 0)];
    } else {
      return getDefaultValue();
    }
  }
1222570
public String[] getSelectedValues() {
        List<WebElement> options = getElement().findElements(By.tagName("option"));
        List<String> selected = new ArrayList<String>();
        for (WebElement option : options) {
            if (option.isSelected()) {
                selected.add(option.getAttribute("value"));
            }
        }
        return (String[]) selected.toArray(new String[selected.size()]);
    }
811318
private String getElementValue(Element parent, String elementName) {
        String value = null;
        NodeList nodes = parent.getElementsByTagName(elementName);
        if (nodes.getLength() > 0) {
            value = nodes.item(0).getChildNodes().item(0).getNodeValue();
        }
        return value;
    }
1171571
public boolean select() {
        boolean isSelect = false;
        try {
            WebElement webElement = element.getWebElement();
            if (SELECT.equalsIgnoreCase(webElement.getTagName())) {
                isSelect = true;
            }
        } catch (NoSuchElementException e) {
            log.info(e);
        }
        return isSelect;
    }