开发者

Could anyone help me fix this xpath expression?

Time for another silly question :)

I got some tab开发者_JS百科les in a xhtml-document with class="mytable" and inside those tables all sorts of elements, including <input type="checkbox"/> .. Now, I need to select all these checkboxes. I figured I'd use jquery with xpath, but my expression doesnt seem to work.

So far, I've come up with

$("table[class=mytable]//input[type=checkbox]")

.. but that doesnt seem to work :( Any help is appreciated :)


I would use Css selectors not xpath

$('table.mytable input[type="checkbox"]')


$("table[@class='mytable']//input[@type='checkbox']")

I think you need the @ symbol to target attributes and single quotes around the attribute values

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜