Created
June 28, 2019 15:20
-
-
Save LiamChapman/4bb53ac03b0c5a53ae835379a1392b4d to your computer and use it in GitHub Desktop.
Years Dropdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return( | |
| <select name="years" id="years"> | |
| { [...Array(40).keys()].map( (i, k) => i > 0 && <option key={ k } value={ i + 1 } selected={ parseInt(value, 10) === ( i + 1 ) }>{ i + 1 } years</option> ) } | |
| </select> | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment