網頁

Angular JS

輸入這種飲料的名字(中文:三個字)

result : {{result}}

var app = angular.module('jsbin', []); app.controller('DemoCtrl', function($scope) { $scope.answer = 'here'; $scope.result = ''; $scope.changeAnswer = function(){ switch($scope.answer) { case '龍舌蘭': $scope.result = '答對啦!龍舌蘭是提煉自....'; break; case '龍舌蘭酒': $scope.result = '答對啦!龍舌蘭是提煉自....'; break; default: $scope.result = '沒猜中哩!找找現地的植物,再想想~'; } } });