JeanL
13 years agoContributor
SPAN tag without text
How can I reach SPAN tag which has no text in it:
HTML:
<DIV id="main_panel">
<SPAN class="someclass"></SPAN>
<SPAN class="status_error"></SPAN>
<SPAN class="someotherclass"></SPAN>
</DIV>
<DIV id="main_panel_2">
<SPAN class="someclass"></SPAN>
<SPAN class="status_error"></SPAN>
<SPAN class="someotherclass"></SPAN>
</DIV>
<DIV id="main_panel_3">
<SPAN class="someclass"></SPAN>
<SPAN class="status_error"></SPAN>
<SPAN class="someotherclass"></SPAN>
</DIV>
I would like to get the SPAN object which is inside the DIV "main_panel" and which class is "status_error". Class of the SPAN can also be "status_ok", and that's what i would like to check, which one it is. I have tried this:
Set object = page.Panel("main_panel")
propArray = Array("tagName", "className")
valuesArray = Array("SPAN", "status_*")
Set temp = page.FindChild(propArray, valuesArray, 100)
If StrComp(temp.className, "status_error", 1) = 0 Then ...
FindChild returns nothing. I guess it's because the SPAN doesn't have any text in it, am I right? I can't use firstchild, lastchild etc. properties because the number of child elements of the DIV and the place of the SPAN object I need varies.
So how can I check is the class of the SPAN "status_error" or "status_ok"?
HTML:
<DIV id="main_panel">
<SPAN class="someclass"></SPAN>
<SPAN class="status_error"></SPAN>
<SPAN class="someotherclass"></SPAN>
</DIV>
<DIV id="main_panel_2">
<SPAN class="someclass"></SPAN>
<SPAN class="status_error"></SPAN>
<SPAN class="someotherclass"></SPAN>
</DIV>
<DIV id="main_panel_3">
<SPAN class="someclass"></SPAN>
<SPAN class="status_error"></SPAN>
<SPAN class="someotherclass"></SPAN>
</DIV>
I would like to get the SPAN object which is inside the DIV "main_panel" and which class is "status_error". Class of the SPAN can also be "status_ok", and that's what i would like to check, which one it is. I have tried this:
Set object = page.Panel("main_panel")
propArray = Array("tagName", "className")
valuesArray = Array("SPAN", "status_*")
Set temp = page.FindChild(propArray, valuesArray, 100)
If StrComp(temp.className, "status_error", 1) = 0 Then ...
FindChild returns nothing. I guess it's because the SPAN doesn't have any text in it, am I right? I can't use firstchild, lastchild etc. properties because the number of child elements of the DIV and the place of the SPAN object I need varies.
So how can I check is the class of the SPAN "status_error" or "status_ok"?