This can be simplified using [jQuery.each](http://api.jquery.com/each/):
```js
list.each(function(i) {
  this.val(val[i] || null)
      .attr('placeholder', placeholders[i]);
})
```