Skip to content

Commit

Permalink
clear ul on submmit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtrevisan authored Apr 4, 2024
1 parent 4df38f1 commit 25fd504
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ gitHubForm.addEventListener('submit', (e) => {
// update html with data from github
if (data.message === "Not Found") {
let ul = document.getElementById('userRepoCommits');
ul.innerHTML = '';

// Create variable that will create li's to be added to ul
let li = document.createElement('li');
Expand All @@ -40,6 +41,7 @@ gitHubForm.addEventListener('submit', (e) => {
ul.appendChild(li);
} else {
let ul = document.getElementById('userRepoCommits');
ul.innerHTML = '';

for (let i in data) {
// Create variable that will create li's to be added to ul
Expand Down

0 comments on commit 25fd504

Please sign in to comment.