src/Concerns/InteractsWithElements.php
public function value($selector, $value = null)
    {
        if (is_null($value)) {
            return $this->resolver->findOrFail($selector)->getAttribute('value');
        }

        $selector = $this->resolver->format($selector);

        $this->driver->executeScript(
            "document.querySelector('{$selector}').value = '{$value}';"
        );

        return $this;
    }
public function value($selector, $value = null)
    {
        if (is_null($value)) {
            return $this->resolver->findOrFail($selector)->getAttribute('value');
        }

        $selector = $this->resolver->format($selector);

        $this->driver->executeScript(
            "document.querySelector('{$selector}').value = '{$value}';"
        );

        return $this;
    }
public function value ( $ selector , $ value = null ) { if ( is_null ( $ value ) ) { return $ this -> resolver -> findOrFail ( $ selector ) -> getAttribute ( 'value' ) ; } $ selector = $ this -> resolver -> format ( $ selector ) ; $ this -> driver -> executeScript ( "document.querySelector('{$selector}').value = '{$value}';" ) ; return $ this ; }
Directly get or set the value attribute of an input field.

@param  string  $selector
@param  string|null  $value
@return $this
Directly get or set the value attribute of an input field .