-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckboxnormal.html
More file actions
49 lines (40 loc) · 873 Bytes
/
checkboxnormal.html
File metadata and controls
49 lines (40 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="angular.min.js"></script>
</head>
<body>
<div ng-app="myapp" ng-controller="myctrl">
<input type="checkbox" value="C" ng-model="c1" />C
<br>
<input type="checkbox" value="CPP" ng-model="c2" />CPP
<br><br>
<input type="button" value="Click" ng-click="fun()" />
{{msg}}
</div>
<script type="text/javascript">
var app = angular.module('myapp',[]);
app.controller('myctrl',function($scope)
{
$scope.c1='';
$scope.c2='';
s1='';
s2='';
$scope.fun=function()
{
if ($scope.c1)
s1='C';
else
s1='';
if ($scope.c2)
s2='CPP';
else
s2='';
$scope.msg= s1+s2;
}
}
)
</script>
</body>
</html>