angular.js - In angularjs, select the checkbox and add a classname to its upper level, uncheck to remove the classname
巴扎黑
巴扎黑 2017-05-15 16:53:17
0
2
772

When the check box is selected, a classname is added to li. When it is deselected, the classname of li is removed
I’ve been searching for a long time but haven’t found a good way to operate the dom

巴扎黑
巴扎黑

reply all(2)
淡淡烟草味

Use ng-class
ng-class="{'className':value}"
When value is true, className style will be applied

为情所困

If you use class,最好给li一个ng-class,<li ng-class="{true: 'clasname'}[checked == true]" ></li>~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template