-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial.html
More file actions
53 lines (47 loc) · 1.31 KB
/
tutorial.html
File metadata and controls
53 lines (47 loc) · 1.31 KB
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
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<title>jquery tutorials</title>
</head>
<body>
<input name="rd1" id="rd1" type="radio" value="ml">machine learning</input><br />
<input name="rd1" id="rd2" type="radio" value="dl">Deep learning</input><br />
<button id="btn1">click me</button> <br ><br >
<form>
<div class="input1">
<input type="number" class="pc">
</div>
<div class="input1">
<input type="number" class="pc">
</div>
<div class="input1">
<input type="number" class="pc">
</div>
<div class="input1">
<p id="result"></p>
</div>
</form>
<script src="js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$('#btn1').click(function(){
/* alert($('input[name="rd1"]:checked').val())*/
let myradio = $('input[name="rd1"]:checked').val()
if(myradio===undefined){
alert('checked one rdaio button')
}
})
$('.input1').on('input','.pc',function(){
var totalsum = 0;
$('.input1 .pc').each(function(){
var inputval = $(this).val();
if($.isNumeric(inputval)){
totalsum += parseInt(inputval);
}
});
$('#result').text(totalsum);
})
});
</script>
</body>
</html>