Please I'm creating a sign up page and needed to add birthday to it. So I used "select" to create the day and month but it becomes practically impossible to use "select" since years is usually much maybe from 1900s till present. please how can i use code to fix that problem? I mean how can i create a dropdown that users can pick their birth year from?
Thanks for your reply.
1. One way to achieve this is using input type date
You can use <input type="date">.
Documentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
<input> elements of type="date" create input fields that let the user enter a date. You can also add a minimum and maximum date validation.
<label for="birthday">Enter Birthday:</label>
<input type="date" id="birthday" name="birthday" value="2021-11-14">
2. The second way to achieve these using libraries like: