File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ function render() {
7676 changeBut . className = "btn btn-success" ;
7777 wasReadCell . appendChild ( changeBut ) ;
7878 let readStatus = "" ;
79- if ( myLibrary [ i ] . check == false ) {
80- readStatus = "Yes" ;
81- } else {
79+ if ( myLibrary [ i ] . check == "false" ) {
8280 readStatus = "No" ;
81+ } else {
82+ readStatus = "Yes" ;
8383 }
8484 changeBut . innerText = readStatus ;
8585
@@ -88,6 +88,29 @@ function render() {
8888 render ( ) ;
8989 } ) ;
9090
91+
92+ // second option to booleans comparisons
93+ // let changeBut = document.createElement("button");
94+ // changeBut.id = i;
95+ // changeBut.className = "btn btn-success";
96+ // wasReadCell.appendChild(changeBut);
97+ // let readStatus = "";
98+
99+ // // Directly check for boolean value (true or false)
100+ // if (myLibrary[i].check == false) {
101+ // readStatus = "No";
102+ // } else {
103+ // readStatus = "Yes";
104+ // }
105+
106+ // changeBut.innerText = readStatus;
107+
108+ // changeBut.addEventListener("click", function () {
109+ // myLibrary[i].check = !myLibrary[i].check; // Toggle the read status
110+ // render();
111+ // });
112+
113+
91114 //add delete button to every row and render again
92115 let delButton = document . createElement ( "button" ) ;
93116 delBut . id = i + 5 ;
You can’t perform that action at this time.
0 commit comments