How to select all check boxes using jquery in spri

2019-08-19 06:30发布

This is the spring form, how to select all the checkboxes using jquery?

<form:form name="form" method="POST" commandName="da"> 
<table cellspacing="7">
    <tr>
        <td>Increment DA by:</td>
        <td><form:input path="da" id="da"/></td>
    </tr>
    <tr>
        <td>
        <form:checkboxes items="${empids}" path="empids" delimiter="<br/>" id="empids"/>
        </td>

    </tr>
    <tr>
        <td colspan="2"><input type="submit" value="Save" ></td>    
    </tr>
</table>
</form:form>

1条回答
beautiful°
2楼-- · 2019-08-19 06:36

give a common class to all checkboxes and then try this...

$('.commonClass').attr('checked',true);
查看更多
登录 后发表回答