Use 'onchange' instead of 'onclick'.