capybara/node/simple.py
def value(self):
        """ str: The value of the form element. """

        if self.tag_name == "textarea":
            return inner_content(self.native)
        elif self.tag_name == "select":
            if self["multiple"] == "multiple":
                selected_options = self._find_xpath(".//option[@selected='selected']")
                return [_get_option_value(option) for option in selected_options]
            else:
                options = (
                    self._find_xpath(".//option[@selected='selected']") +
                    self._find_xpath(".//option"))
                return _get_option_value(options[0]) if options else None
        elif self.tag_name == "input" and self["type"] in ["checkbox", "radio"]:
            return self["value"] or "on"
        else:
            return self["value"]
def value(self):
        """ str: The value of the form element. """

        if self.tag_name == "textarea":
            return inner_content(self.native)
        elif self.tag_name == "select":
            if self["multiple"] == "multiple":
                selected_options = self._find_xpath(".//option[@selected='selected']")
                return [_get_option_value(option) for option in selected_options]
            else:
                options = (
                    self._find_xpath(".//option[@selected='selected']") +
                    self._find_xpath(".//option"))
                return _get_option_value(options[0]) if options else None
        elif self.tag_name == "input" and self["type"] in ["checkbox", "radio"]:
            return self["value"] or "on"
        else:
            return self["value"]
def value ( self ) : if self . tag_name == "textarea" : return inner_content ( self . native ) elif self . tag_name == "select" : if self [ "multiple" ] == "multiple" : selected_options = self . _find_xpath ( ".//option[@selected='selected']" ) return [ _get_option_value ( option ) for option in selected_options ] else : options = ( self . _find_xpath ( ".//option[@selected='selected']" ) + self . _find_xpath ( ".//option" ) ) return _get_option_value ( options [ 0 ] ) if options else None elif self . tag_name == "input" and self [ "type" ] in [ "checkbox" , "radio" ] : return self [ "value" ] or "on" else : return self [ "value" ]
str: The value of the form element.
str : The value of the form element .