-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo11.html
More file actions
59 lines (47 loc) · 1.54 KB
/
demo11.html
File metadata and controls
59 lines (47 loc) · 1.54 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
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<title>Jquery Practice</title>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
</head>
<body>
<div class="inpt">
<label><input type="checkbox" name="skill" value="Chaeckbox 1" /> Chaeckbox 1</label>
<label><input type="checkbox" name="skill" value="Chaeckbox 2" /> Chaeckbox 2</label>
<label><input type="checkbox" name="skill" value="Chaeckbox 3" /> Chaeckbox 3</label>
<label><input type="checkbox" name="skill" value="Chaeckbox 4" /> Chaeckbox 4</label>
<label><input type="checkbox" name="skill" value="Chaeckbox 5" /> Chaeckbox 5</label>
<label><input type="checkbox" name="skill" value="Chaeckbox 6" /> Chaeckbox 6</label>
</div><br>
<button class="btn2">Click</button>
<script>
$(document).ready(function(){
$('.btn2').click(function(){
let chk = new Array;
//alert($('.inpt input[name="skill"]').val())
if($('.inpt input[name="skill"]:checked').length < 1){
//alert('Pease select 1 checkbox');
}
$('.inpt input[name="skill"]:checked').each(function(i, chk){
//alert($(chk).val())
chk.push($(chk).val());
})
var a = decodeURI(getUrlVars()["Title"]);
alert(a);
})
})
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
</script>
</body>
</html>