Page 1 of 1

Check for an element in the page

Posted: Fri Jan 30, 2015 1:55 pm
by rmarsh
Is there a way to check if an element has been loaded?

I am extracting text from elements to use in a text box, however, the element is not always loaded and when it is not I am getting an error "D_2_2 is not defined."

Re: Check for an element in the page

Posted: Fri Jan 30, 2015 2:02 pm
by Alex
Something like this could do it...

Code: Select all

if (getObj("D_2_2") != null) {  // see if element exists
  // do something with element
}