public function addClass($class) { $script = sprintf("if(!arguments[0].className.match(/\\b{$class}\\b/))arguments[0].className+=' {$class}'"); $this->_driver->executeScript($script, array(array('ELEMENT' => $this->_elementId))); return $this; }