-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
92 lines (79 loc) · 2.86 KB
/
Copy pathtest.html
File metadata and controls
92 lines (79 loc) · 2.86 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>컴마안찍어줘</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/components/button.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/components/grid.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/components/form.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/components/input.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/components/header.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/components/icon.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/components/form.min.js"></script>
</head>
<body>
<div class="ui form">
<h1 class="ui dividing header"> 컴마찍어줘 </h1>
<div class="field">
<label> 번호 리스트 </label>
<textarea id="phone"></textarea>
</div>
<div class="field">
<div id="activate" class="ui icon button"> 컴마찍어줘 </div>
<div id="activate2" class="ui icon button"> 0 넣어서 컴마찍어줘 </div>
<div id="activate3" class="ui icon button"> ' 붙혀서 컴마찍어줘 </div>
<div id="activate4" class="ui icon button"> 0 넣고 ' 붙혀서 컴마찍어줘 </div>
</div>
<div class="field">
<label> Result </label>
<textarea id="result"></textarea>
</div>
</h1>
</div>
<script>
$(document).ready(function() {
$('#activate').click(function(e) {
e.preventDefault();
const delim = '\n';
let as = $('#phone').val().split(delim);
let result = "";
for (var i = 0; i < as.length; i++) {
result = result + as[i] + ","
}
$('#result').val(result.slice(0,-1));
});
$('#activate2').click(function(e) {
e.preventDefault();
const delim = '\n';
let as = $('#phone').val().split(delim);
let result = "";
for (var i = 0; i < as.length; i++) {
result = result + "0" + as[i] + ","
}
$('#result').val(result.slice(0,-1));
});
$('#activate3').click(function(e) {
e.preventDefault();
const delim = '\n';
let as = $('#phone').val().split(delim);
let result = "";
for (var i = 0; i < as.length; i++) {
result = result + "'" + as[i] + "'" + ","
}
$('#result').val(result.slice(0,-1));
});
$('#activate4').click(function(e) {
e.preventDefault();
const delim = '\n';
let as = $('#phone').val().split(delim);
let result = "";
for (var i = 0; i < as.length; i++) {
result = result + "'0" + as[i] + "'" + ","
}
$('#result').val(result.slice(0,-1));
});
});
</script>
</body>
</html>