开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜