Friday, January 13, 2012

To select current year selected in an year dropdown

var d = new Date();
var curr_year = d.getFullYear();

$("#dropdownid option[value='"+curr_year+"']").attr('selected', 'selected');

No comments:

Post a Comment