开发者

Could anyone help me fix this xpath expression?

开发者 https://www.devze.com 2022-12-21 21:29 出处:网络
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\"/>

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

精彩评论

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