lib/Webforge/DOM/Query.php
public function attr($name, $value = NULL) {
    if (($el = $this->getElement()) === NULL) return NULL;

    if ($el->hasAttribute($name)) {
      if (func_num_args() == 2) {
        $el->setAttribute($name, $value);
      }

      return $el->getAttribute($name);
    }

    return NULL;
  }
public function attr($name, $value = NULL) {
    if (($el = $this->getElement()) === NULL) return NULL;

    if ($el->hasAttribute($name)) {
      if (func_num_args() == 2) {
        $el->setAttribute($name, $value);
      }

      return $el->getAttribute($name);
    }

    return NULL;
  }
public function attr ( $ name , $ value = NULL ) { if ( ( $ el = $ this -> getElement ( ) ) === NULL ) return NULL ; if ( $ el -> hasAttribute ( $ name ) ) { if ( func_num_args ( ) == 2 ) { $ el -> setAttribute ( $ name , $ value ) ; } return $ el -> getAttribute ( $ name ) ; } return NULL ; }
Returns or sets the attribute of the first matched Element

@param mixed $value if $value is provided the attribute is set to this value
@return string|NULL
Returns or sets the attribute of the first matched Element