use .val() instead of [0]