close

[Solved] Property ‘value’ does not exist on type EventTarget in TypeScript

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Property ‘value’ does not exist on type EventTarget in TypeScript in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Property ‘value’ does not exist on type EventTarget in TypeScript Error Occurs?

Today I get the following error Property ‘value’ does not exist on type EventTarget in TypeScript in javascript.

How To Solve Property ‘value’ does not exist on type EventTarget in TypeScript Error ?

  1. How To Solve Property 'value' does not exist on type EventTarget in TypeScript Error ?

    To Solve Property 'value' does not exist on type EventTarget in TypeScript Error Try code below:
    console.log(event['target'].value)
    it works for me 🙂

  2. Property 'value' does not exist on type EventTarget in TypeScript

    To Solve Property 'value' does not exist on type EventTarget in TypeScript Error Try code below:
    console.log(event['target'].value)
    it works for me 🙂

Solution 1

Passing HTMLInputElement as a generic to the event type should work too:

onUpdatingServerName(event: React.ChangeEvent<HTMLInputElement>) {
  console.log(event);
  this.newserverName = event.target.value;
}

Solution 2

Try code below:

  console.log(event['target'].value)

it works for me 🙂

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment