public function datalist($entries = [])
    {
        $this->defaultAttribute('list', "list-{$this->id}");

        $datalist = "<datalist id=\"list-{$this->id}\">";
        foreach ($entries as $k => $v) {
            $datalist .= "<option value=\"{$k}\">{$v}</option>";
        }
        $datalist .= '</datalist>';

        return $this->append($datalist);
    }
public function datalist($entries = [])
    {
        $this->defaultAttribute('list', "list-{$this->id}");

        $datalist = "<datalist id=\"list-{$this->id}\">";
        foreach ($entries as $k => $v) {
            $datalist .= "<option value=\"{$k}\">{$v}</option>";
        }
        $datalist .= '</datalist>';

        return $this->append($datalist);
    }
public function datalist ( $ entries = [ ] ) { $ this -> defaultAttribute ( 'list' , "list-{$this->id}" ) ; $ datalist = "<datalist id=\"list-{$this->id}\">" ; foreach ( $ entries as $ k => $ v ) { $ datalist .= "<option value=\"{$k}\">{$v}</option>" ; } $ datalist .= '</datalist>' ; return $ this -> append ( $ datalist ) ; }
Add datalist element to Text input.

@param array $entries

@return $this
Add datalist element to Text input .