-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
46 lines (33 loc) · 870 Bytes
/
main.js
File metadata and controls
46 lines (33 loc) · 870 Bytes
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
const API_URL = "https://api.github.com/users";
const Table = document.querySelector("table");
const btn = document.querySelector(".del");
//const tr = document.querySelector("#trr");
fetch(API_URL)
.then((res)=>{
res.json().then((data)=>{
console.log(data);
//Table.innerHTML = datas;
let container = ` <tr>
<th>ID</th>
<th>Name</th>
<th>Reposatory</th>
<th>Remove</th>
</tr>`;
for(ids of data){
container += `
<tr>
<th>${ids.id}</th>
<th>${ids.login}</th>
<th>${ids.avatar_url}</th>
<td><button type="delete">Delete</button></td>
</tr>
`;
}
// btn.addEventListener("click", ()=>{
// tr.style.backgroundColor = "blue";
// });
Table.innerHTML = container;
})
}).catch((err)=>{
return err;
});