views:

16

answers:

1

hi,

i try to find the web page has the html element or not. i use if condition, like;

    if([webView stringByEvaluatingJavaScriptFromString:@"return document.getElementById('txtOgR_no');"] != nil)
    {...}

how can i check is there a element in page named "txtOgr_No" ?

+1  A: 

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.

Sean Kinsey
thanks it's working.
Can