-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
40 lines (32 loc) · 940 Bytes
/
script.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
29
30
31
32
33
34
35
36
37
38
39
var elBtnList = document.getElementById("btn-list");
function add(){
var position = document.getElementById("input-position").value;
var x = document.getElementById("input-text").value;
if(x != "" && position != ""){
//
// Get node list for btn-list and count. Check position.
//
//
// Clear the input field and create the new button
//
document.getElementById("input-text").value = "";
var li = document.createElement("li");
li.className = "btn";
var textNode = document.createTextNode(x);
elBtnList.appendChild(li).appendChild(textNode);
}
else {
alert("Please enter a label name and a position for your new button");
}
document.getElementById("input-text").focus();
}
function remove(){
//
// removeChild() ?
//
}
function Update(){
//
// What is this exactly for
//
}