![](/img/trans.png)
[英]Can someone please assits me as to why this function is not doing what i want it too
[英]my javascript, html and css is not doing what i want it too. can i please have some assistance with my todo list app
我的目標是修復我擁有的代碼,以便在我添加待辦事項時
當我添加一個待辦事項時,我得到一個刪除線 當我單擊該項目的單選按鈕以顯示我已完成時,我只想要一個刪除線
它是一個小型 git
任何幫助將不勝感激[https://github.com/breakfireaus/todo-list.git][1]
問題是,您想根據待辦事項的 state 修改輸入文本。 我將解釋如何做你想做的事情。 其他一切都取決於你。
.todo-item .todo-content input {
/* text-decoration: line-through; */
color: var(--grey);
}
.strikethroughStyle{
text-decoration: line-through;
}
const textToStrikeThrough = todoItem.querySelector(".todo-content").querySelector("input");
if (todo.done) {
todoItem.classList.add('done');
textToStrikeThrough.classList.add("strikethroughStyle");
} else {
textToStrikeThrough.classList.remove("strikethroughStyle");
}
不客氣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.