-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
33 lines (24 loc) · 825 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
const addBtn = document.querySelector(".add");
const input = document.querySelector(".inp-group");
function removeInput(){
this.parentElement.remove();
}
function addInput(){
const name = document.createElement("input");
name.type="text";
name.placeholder = "Enter Reciver's Name";
const address = document.createElement("input");
address.type="text";
address.placeholder = "Enter Full Address ";
const btn=document.createElement("a");
btn.className = "delete";
btn.innerHTML = "×";
btn.addEventListener("click", removeInput);
const flex=document.createElement("div");
flex.className = "flex";
input.appendChild(flex);
flex.appendChild(name);
flex.appendChild(address);
flex.appendChild(btn);
}
addBtn.addEventListener("click", addInput);