-
Notifications
You must be signed in to change notification settings - Fork 20
Query AddBack
Thomas Weinert edited this page Jul 12, 2018
·
3 revisions
FluentDOM\Query addBack();
Add the previous selection to the current selection.
$xml = <<<XML
<html>
<head>
<title>Examples: FluentDOM\Query::addBack()</title>
</head>
<body>
<p>I would like to say: <b>HELLO</b></p>
<b>HELLO</b>
<div>Another list of childNodes</div>
</body>
</html>
XML;
$fdQuery = FluentDOM($xml);
echo $fdQuery
->find('//p')
->find('.//b')
->addBack()
->toggleClass('inB');
<?xml version="1.0"?>
<html>
<head>
<title>Examples: FluentDOM\Query::addBack()</title>
</head>
<body>
<p class="inB">I would like to say: <b class="inB">HELLO</b></p>
<b>HELLO</b>
<div>Another list of childNodes</div>
</body>
</html>
- Home
- Getting Started
- Tasks
- Plugins
- Functions
- Lists
- Creator (5.1)
- CSS Selectors
- Convertors
- Loaders
- Serializers (5.1)
- Transformers (5.1)
- Extended DOM
- XMLReader (6.1)
- XMLWriter (6.1)
- Interfaces