Skip to content

Can we add a condition, when submit is clicked the input box should become empty again.? #7

@Rishabh8770

Description

@Rishabh8770

lesson 11
Project to add items

main.ts file:

Screenshot 2024-04-11 172820

added a screenshot with code added. please check
I am posting a written code as well

   const input = document.getElementById("newItem") as HTMLInputElement
    const newEntryText: string = input.value.trim()
    if (!newEntryText.length) return
    if (SubmitEvent) {
        input.value = ''
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions