[SOLVED] Input date value null | Sololearn: Learn to code for FREE!

0

[SOLVED] Input date value null

Check the code bellow to see and fix the problem https://code.sololearn.com/WxEcRarwAYl1/?ref=app

1/30/2022 12:58:10 PM

EsaKurniawan

18 Answers

New Answer

+1

Remove the .value

+1

And also remove get date and add .value there

+1

Already solved it

+1

inputDate,addEventListener( 'input', (evt) => { console.log(new Date(evt.target.value).getDate()); });

0

U didnt made a input element thats why it's showing error

0

I make input element, look at the code didn't you see that?

0

The problem is u have put script tag above your input tag

0

Script tag should be the last element in html

0

EsaKurniawan Why did you add addEventListener ?

0

It throw an error again man helppp me

0

It's says inputDate.getDate() is not a function

0

Mohammed because i want every time inputDate is change then I'll display inputDate value to console

0

But i just want to get date from that input not a date+ month + year

0

Then change the input type to date

0

The input type is already date from we starting this conversation

0

If u just want date then don't have to us input tag u can directly get date month everything separately just using js

0

Let d = new Date(); Console.log(d.getDate())

0

Because i want date from user input