the page has the html element or hasn't - objective c
i try to find the web page has the html element or not. i use if condit开发者_开发问答ion, like;
if([webView stringByEvaluatingJavaScriptFromString:@"return document.getElementById('txtOgR_no');"] != nil)
{...}
how can i check is there a element in page named "txtOgr_No" ?
This returns a boolean value
return !!document.getElementById('txtOgR_no');
And by 'named' I guess you mean 'have an id of ..' as names are only used for form elements.
精彩评论