Can you help me understand how to implement this JavaScript code in Objective-C?
var theFormId = $('form').filter(function() {
return this.innerHTML.indexOf('forgot your password') != -1;
}).attr('id');
Is there a way to integrate the code above using the stringByEvaluatingJavaScriptFromString: method in UIWebView?
In attempting to use the aforementioned code with Objective-C, I did the following:
NSString *formID = [NSString stringWithFormat:@"%@",[self.browser stringByEvaluatingJavaScriptFromString:@"$('form').filter (function() {var text = this.innerHTML.toLowerCase();"
"return text.indexOf('forgot your password') != -1 || "
"text.indexOf('remember me') != -1;}).attr('id');"] ];
After attempting to log formID, it seems to print nothing. Could there be a syntax error present in my code?