<!DOCTYPE html>
<html>
<body onload="document.getElementById('a').appendChild(document.getElementById('b'));">

<div id="b"></div>
<div style="filter: url(#b);"></div>
<div id="a"></div>

</body>
</html>