Skip to content

Instantly share code, notes, and snippets.

@fieldoffice
Created January 12, 2015 19:19
Show Gist options
  • Save fieldoffice/94c490ad69b77ef7b71d to your computer and use it in GitHub Desktop.
Save fieldoffice/94c490ad69b77ef7b71d to your computer and use it in GitHub Desktop.
Card Expiry Year
<script type="text/javascript">
var select = $('.card-expiry-year'),
year = new Date().getFullYear();
for (var i = 0; i < 12; i++) {
select.append($("<option value='"+(i + year)+"' "+(i === 0 ? "selected" : "")+">"+(i + year)+"</option>"))
}
</script>
<select class="card-expiry-year"></select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment