use val instead of attr('value')