+ 2

Input focus js

Why this input doesn't show the date when i click show alert button, even though i use .focus() Function to get focus from that input. https://code.sololearn.com/WXYobQ0F08DJ/?ref=app

2nd Feb 2022, 1:40 AM
EsaKurniawan
7 Antworten
+ 2
The input does get focus, but you need to click the arrow option to get the date selection screen. In case you think your focus function isn't working, it is working fine and below is the proof it works https://code.sololearn.com/W6sYPL5r949d/?ref=app
2nd Feb 2022, 2:09 AM
Rishi
Rishi - avatar
+ 2
Ipang thank you it's working
2nd Feb 2022, 2:28 AM
EsaKurniawan
+ 1
How do i can get date show when i clicked show alert button?
2nd Feb 2022, 2:25 AM
EsaKurniawan
+ 1
You can trigger the date input by calling the default click event handler after setting the focus on it inputDate.focus(); inputDate.click();
2nd Feb 2022, 2:26 AM
Ipang
+ 1
Is there any JavaScript function to do that?
2nd Feb 2022, 2:26 AM
EsaKurniawan
+ 1
Just add inputDate.click(); After inputDate.focus() It works in my phone, haven't tested it in browser ...
2nd Feb 2022, 2:29 AM
Ipang
0
Password show problem
2nd Feb 2022, 4:30 PM
Hari Sah
Hari Sah - avatar