use val() instead of attr