Good afternoon. I used the search but did not find the answer I was looking for, I think this is a general question.
Is there any solution for getting the value of the nth element via jQuery?
Here is a simple example: Imagine that we have n inputs with one class. The easiest way to get the value of the nth, as I thought, is $(".some_class").get(n-th).val() is the easiest way. But when we use get() , it returns
#HTMLInputElement Object
So, after using val() on it, we got an error:
Uncaught TypeError: Object #HTMLInputElement does not have a 'val' method.
Is there any solution how to use only jQuery methods in this situation?
source share