public function prop($name, $value = null)
{
switch (strtolower($name)) {
case 'checked':
case 'disabled':
case 'selected':
if ($value !== null) {
if ($value) {
$this->attr($name, $name);
} else {
$this->removeAttr($name);
}
return $this;
}
return $this->attr($name) == $name;
case 'tagname':
return $this->tagName($value);
}
// The property is not supported, degrade gracefully
if ($value === null) {
return $this;
} else {
return null;
}
}