首页 > 代码库 > javascript动态的改变checkbox的选中状态

javascript动态的改变checkbox的选中状态

 1 <td>
 2    <div class="checkbox">
 3         <label>
 4             <input type="checkbox" id="id_{$vo.id}" value="http://www.mamicode.com/{$vo.status}" {if condition="$vo.status eq ‘1‘"}checked{/if} />锁定
 5         </label>
 6    </div>
 7 </td>
 8 <script type="text/javascript">
 9     $("#id_{$vo.id}").click(function(){
10        var status = $(‘#id_{$vo.id}‘).val();
11        $.get("{:url(‘admin/category/status_change‘)}", {id:"{$vo.id}",status:status});
12     });
13 </script>

 

javascript动态的改变checkbox的选中状态