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
精彩评论