- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to detect the browser's format for HTML input type date
An input.the valueAsDate method returns a Date object reflecting the input's current value. The displayed value follows the same format. To make it work:
new Date().toISOString().substr( 0, 10 ); new Date().toLocaleDateString(); input.valueAsDate; input.valueAsDate.toLocaleDateString(); new Date( input.valueAsDate ); new Date( input.valueAsDate ).toISOString().substr( 0, 10 );
Advertisements