I've got a script which returns the original HTML of the current page, which has a form on it:
var orignalHTML = "";
$.get(document.location.href, function(data) {
originalHTML = data;
});
What I'd now like to do, is find any FORM elemnts in this 'originalHTML' variable. I've tried the following, but it returns nothing:
$(originalHTML).find("form")
Any ideas what I'm doing wrong?
As a heads up. I know there's an easier method, that would involve just querying the current page, but I'm looking for any mismatches between forms in the original HTML and the current page.
I also know that there are complexities around synchronicity, but this is about accessing the <form>
field, not about when the variable is populated.
Thank you