html input type year
<html> <head> <title>input type year</title> </head> <body> <input type="date" id="coding"> </body> </html>
html year input
//A year only input is not possible in HTML(only) //An alternative: <input type="number" min="1900" max="2022" step="1" value="2022" />