javascript - jQuery element variable doesn't seem to be accessible? -


Then I get a set of form elements that I want to remove values ​​using

 I  Miscellaneous input = $ ("input.row_2"); Input [0] .val ()  

When I run it, I am told that Val is not a valid method.

What am I doing wrong?

One should be easy .. Thanks!

input [0] gives you the DOM element, so The input will be [0] .value which you want.

You can also use inputs.eq (0) .val () which will never complain that the input [0] is compulsory If there are no matches.

Unlike a jQuery object return (not a dom), which you will get from using [0]


Comments