try this: var elems = $x('//*[@class="name_class"]'), firstElem; if(elems.length) { firstElem = elems[0]; } console.log(firstElem);.
確定! 回上一頁