Can I use an HTML input type "date" to collect only a year?

No, you can't, it doesn't support only year, so to do that you need a script, like jQuery or the webshim link you have, which shows year only.


If jQuery would be an option, here is one, borrowed from Sibu:

Javascript

$(function() {
    $( "#datepicker" ).datepicker({dateFormat: 'yy'});
});​

CSS

.ui-datepicker-calendar {
   display: none;
}

Src: https://stackoverflow.com/a/13528855/2827823

Src fiddle: http://jsfiddle.net/vW8zc/

Here is an updated fiddle, without the month and prev/next buttons


If bootstrap is an option, check this link, they have a layout how you want.


No you can not, but input type number provides exactly the functionality you need for this purpose.

Example:

<input type="number" min="1900" max="2099" step="1" value="2016" />