jquery - Find the last visible textbox index number -


i want find last visible textbox index number jquery, have tried code below giving wrong index number :

var lastindex = $('input[type=text]').filter(':visible:last').index(); 

your problem caused fact index() looking @ siblings. you're selector working fine, see http://jsfiddle.net/2ueea/.

try following:

$('input[type=text]').filter(':visible:last').index('input[type=text]');

you'll index of input in relation other inputs on page. if that's not want receive, tell us.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -