Use `.on 'click'` instead of `.click`
Fix to use `.val()`

`.attr('value')` is not working in jQuery 2.0