Query Next - ThomasWeinert/FluentDOM GitHub Wiki
FluentDOM\Query next([ string $selector = NULL ])
Get a set of elements containing the unique next siblings of each of the given set of elements.
$html = <<<HTML
<html>
<head>
<title>Examples: FluentDOM\Query::next()</title>
</head>
<body>
<div>
<button disabled="disabled">First</button> <b>-</b> <span> </span></div>
<div><button>Second</button> - <span> </span></div>
<div><button disabled="disabled">Third</button> - <span> </span></div>
</body>
</html>
HTML;
echo FluentDOM($html)
->find('//button[@disabled]')
->next()
->next()
->text('This button is disabled.');
<?xml version="1.0"?>
<html>
<head>
<title>Examples: FluentDOM\Query::next()</title>
</head>
<body>
<div>
<button disabled="disabled">First</button> <b>-</b> <span>This button is disabled.</span></div>
<div><button>Second</button> - <span> </span></div>
<div><button disabled="disabled">Third</button> - <span>This button is disabled.</span></div>
</body>
</html>