Removing a div from a variable

Removing a div from a variable

Hello all,

I've been researching the web and fiddling around for hours now.

All I want to do in pseudo-code terms is the above.

Suppose $page holds a variable that holds a cached page,
and divid holds the textual ID of a div within $page.

I've tried lot's of variants including the straight-forward one:

  1. $page.find(divid).remove();

 Nothing works.

Any ideas?


Thanks in advance and kind regards