using xpath or css : How to get something which is selected on page
using xpath or css : How to get something which is selected on page using following html code. in following code, Element1 is selected on page and I 开发者_StackOverflow社区wanted to find name of element that is selected on page.
<div id="idc" class="tre">
<ul id="idCatT_srt_ul" class="abc">
<li class="treN treB treSelected" title="Element1 title">
<span class="spclass">Element1</span>
</li>
</ul>
</div>
Guessing that you're looking for the <li>
that contains selected
you can do that with Xpath or CSS selectors like this:
XPath: (if I remember right...)
//*[contains(@class,"selected")]
CSS Selectors:
.treSelected
精彩评论