1. 首页
  2. SEO技术

angular.js ng-click点击事件切换类

gooood个人博客网站

angular

angular.js ng-click点击事件切换类
<!DOCTYPE html> <html> <head> <style> .c {padding: 20px;background: #00adff;} .a {background: #43dd31;} .b {border: 5px dashed yellow;} </style> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> </head> <body> <div ng-app=""> <div ng-class="{'a': toggle, b: secondToggle}"> <button ng-click="toggle = !toggle">Toggle</button> <button ng-click="secondToggle = !secondToggle">Second Toggle</button> </div> </div> </body> </html>

本文来自SEO排名优化_SEO技术_SEO资讯网,经授权后发布,转载请联系原作者。原文链接:http://www.ylzug.com/js/421.html