$.each(data, function (i, val) {
if ($('input:text').hasClass(i)) {
$('.' + i).val(val);
}
It works, but im not a big fan of the $('.' + i).val(val);. Must be a smarter way than combining strings using jquery, right?
Build selectors via string concatenation isn’t a big deal. However using two selectors when one will work is wasteful: