Simple jQuery Year Picker Plugin

Today I am going to share a custom picker for select only years. If you need only year picker for your website where user can choose any year then this plugin is for you. YearPicker.js is a lightweight yet configurable year picker for jQuery that makes it easy to select a year from a popup similar to the date picker.



Include following libraries on page.

<link rel="stylesheet" href="yearpicker.css">
<script src=""></script>
<script src="yearpicker.js" async></script>


Create a simple html input field and Add the class ‘yearpicker’.

<input type="text" class="yearpicker" value="" />


You can also apply call the plugin to any text field you need.

$(function() {  

Here is the list of options you can use to customize year picker.

$(function() {  
  autoHide: true,
  year: null,
  startYear: null,
  endYear: null,
  itemTag: 'li',
  selectedClass: 'selected',
  disabledClass: 'disabled',
  hideClass: 'hide',
  highlightedClass: 'highlighted'

See live demo and download source code.


This awesome plugin is developed by saravanajd. Visit their official github repository for more information and follow for future updates.