- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/web/dom/document.php
- Класс: BitrixMainWebDOMDocument
- Вызов: Document::getElementsByAttr
public function getElementsByAttr($attrName, $attrValue = null, $limit = 0)
{
$attrName = mb_strtolower($attrName);
$nodeList = $this->getQueryEngine()->walk(
array(
array(
QueryEngine::FILTER_ATTR_VALUE => array(
array(
'name' => $attrName,
'value' => $attrValue,
'operation' => QueryEngine::FILTER_OPERATION_EQUAL,
)
)
)
),
null, $this, $limit
);
if(Node::$isNodeListAsArray)
{
return $nodeList;
}
else
{
return new NodeList($nodeList);
}
}