Skip to content

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

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 = ''
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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