text() return the combined text contents of all matched elements (such as p, div, and so on)
val() is used to obtain the value of an input element (such as input, select, and so on)
according to the official documentation text() should not be used with input elements