Angular.js How to change an elements css class on click and to remove all others

前端 未结 6 1605
南旧
南旧 2020-12-22 17:27

i\'m trying to make my two elements toggle, so if one element is clicked it will remove all references of my-class and apply it to its self. Any ideas?



        
6条回答
  •  無奈伤痛
    2020-12-22 18:05

    I only change/remove the class:

       function removeClass() {
                        var element = angular.element('#nameInput');
              element.removeClass('nameClass');
       };
    

提交回复
热议问题