If I understand the context parameter correctly as described in the documentation, p in the following is a collection of two items as expected:
const text = "<body><div class='a'> <p>Test</p> <p>Test 2</p> </div></body>";
const p = $("p", text);
But why do the following all return no results?
const d = $("div", text);
const b = $("body", text);