<input type="text" name="test[ooo][]">
<input type="text" name="test[bbb][]">
<input type="text" name="test[ccc][]">
<input type="text" name="test[vvv][]">
$('input').each(function(){
console.log($(this).attr('name').index('bbb'));
})
Why this not working? How can i check index for attribute name from input?
I don’t must use index(). I can use other function, but how can i check this?
I think you’re looking for
indexOf.console.log($(this).attr(‘name’).indexOf(‘bbb’));
http://jsfiddle.net/5uVd9/