猜大小
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>猜大小</title> <script src="../day19/angular1.4.6.min.js"></script> <style> *{ margin:0; padding:0; } input{ width: 200px; height: 50px; } button{ width: 80px; height: 50px; border: 0; text-align: center; line-height: 50px; color: white; margin-left: 5px; } </style> </head> <body ng-app="m" ng-controller="my"> <h1>请输入一个1-10的整数</h1> <input type="text" ng-model="guess"/><button ng-click="check()">检查</button><button ng-click="reset()">重置</button> <p ng-if="differ>0">猜大了</p> <p ng-if="differ<0">猜小了</p> <p ng-if="differ==0">猜对了</p> <p>你一共才了<span ng-bind="num">0</span>次</p> </body> </html>