Skip to content

Commit

Permalink
Bug Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Soumik committed May 12, 2024
1 parent b8dd51b commit 962aaed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Attendance Manager</title>
<!-- <link rel="stylesheet" href="styles.css"> -->
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="subject">
<h1>Attendance Manager</h1>
<input type="text" placeholder="Add a Subject">
<input type="text" placeholder="Add a Subject" >
<button id="btn">+</button>
<ul class="list">
<!-- <li class="card" id="0">
Expand Down
11 changes: 10 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,18 @@ function createHtml(present,total,subject){
}
})();
function additem(){
if(textbox.value==="") {
textbox.style.background = '#8b0000';
return;
}
const item = document.createElement('li');
item.className='card';
item.innerHTML =createHtml(0,0,textbox.value) ;
item.id=noOfList++;
item.id=btoa(textbox.value);
if(localStorage.getItem(item.id)!=null){
textbox.style.background = '#8b0000';
return;
}
let progressbar=item.querySelector('progress-bar');
addDeleteListener(item);
addPresentListener(item);
Expand All @@ -61,6 +69,7 @@ function additem(){
subject:textbox.value
}
textbox.value="";
textbox.style.background = '#444';
localStorage.setItem(item.id,JSON.stringify(data));
}
textbox.addEventListener("keypress",(e)=>{
Expand Down

0 comments on commit 962aaed

Please sign in to comment.