My original (working) code is:
var input = $('input[name=todo1]').val();
But the problem occurs when I want go to through multiple todo fields (todo1...5). I just have no idea why:
var i=1; var input = $('input[name=todo'+i+']').val();
gives me an error => $("input[name=todo" + i + "]").val is not a function
Any ideas where my thinking is going in the wrong direction or how to do this the correct way?