jquery中如何根据label来选定DOM?


<input type="checkbox" name="filter" id="comedyclubs"/>
<label for="comedyclubs">Comedy Clubs</label>

在上例中,如何才能用jquery选到 label呢?

jquery label选择 开发 js

flywlyx 9 years, 9 months ago

你可以使用如下代码:

$("label[for='comedyclubs']")

具体请参考 jquery官方说明

噼里啪啦2 answered 9 years, 9 months ago

Your Answer