fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://www.fmpq.com/jscss/jquery/1.4.6/angular.min.js"></script> </head> <body ng-app=""> 我喜欢的网站 <select ng-model="myVar"> <option value="runoob">www.fmpq.com <option value="google">www.google.com <option value="taobao">www.taobao.com </select> <hr> <div ng-switch="myVar"> <div ng-switch-when="runoob"> <h1>Fmpq教程</h1> <p>欢迎访问Fmpq教程</p> </div> <div ng-switch-when="google"> <h1>Google</h1> <p>欢迎访问Google</p> </div> <div ng-switch-when="taobao"> <h1>淘宝</h1> <p>欢迎访问淘宝</p> </div> <div ng-switch-default> <h1>切换</h1> <p>选择不同选项显示对应的值。</p> </div> </div> <hr> <p> ng-switch 指令根据当前的值显示或隐藏对应部分。</p> </body> </html>
运行结果