html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<button onclick="f()" id="but">Start</button>
<div style="width: 300px; height: 300px; border:1px solid; display: none;" id="demo">
<input type="text" name="">
<input type="text" name=""><br>
<button onclick="g()">OK</button>
</div>
<div style="width: 300px;height: 300px; border:1px solid; display: none;">
<ol id="demo1">
</ol>
</div>
<script type="text/javascript" src="work.js"></script>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
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
//var set;
function f() {
var a=document.getElementById('demo');
var b=document.getElementById('but');
if (b.innerHTML == "Start"){
b.innerHTML = "Close";
a.style.display="block";
}
else{
b.innerHTML = "Start";
a.style.display="none";
}
}
function g(){
var c=document.getElementById('demo1').parentElement;
c.style.display="block";
var inp=document.getElementsByTagName('input');
// document.getElementById('demo1').innerHTML="";
data="<li>";
for(i=0;i<inp.length;i++){
data+=inp[i].value+=" ";
inp[i].value="";
}
document.getElementById('demo1').innerHTML+=data+"<button onclick='removeEl(this)'>Remove</button></li>";
}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run