jquery - How to add addtional class name on click, other than `mouseenter' in angularjs -
i add additional class name element on click. how add that?
i trying way, not working:
here code :
<div class="row designoption" ng-class="{'active':prodesign}" ng-class="{'activeshow':prodesignadd}"> <span ng-mouseenter="prodesign = true" ng-mouseleave="prodesign = false" ng-click="categoriesadd('prodesign')" class="icon icond">d</span> <span class="info infod">design</span> </div> here shuffling active , on click need add activeshow how that?
syntax add class on element using selector.
$('selector').addclass("classname"); for case, if add class
<span ng-mouseenter="prodesign = true" ng-mouseleave="prodesign = false" ng-click="categoriesadd('prodesign')" class="icon icond">d</span> then try
$('.icond').click(function(){ $('.icond').addclass("activeshow"); // or whatever wish }); for
<span class="info infod">design</span> try
$('.infod').click(function(){ $('.infod').addclass("activeshow"); // or whatever wish }); in both cases, have used 1 of existing class on span selector.
Comments
Post a Comment