javascript - Get value of nth input element using eq() -


var = input.eq(2).val(); alert(parseint(i)); 

i'm trying value of 3rd input, returns nothing. had saying [object] [object] @ 1 point. how value of input?

use jquery's .eq() api this

  var = $('input').eq(2).val();   alert(parseint(i)); 

or code looks has input variable need this

var input = $('input'); var = input.eq(2).val(); alert(parseint(i)); 

js fiddle example


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -