Use 'val' instead of 'selected'.

Selected does not map well onto input types like text or hidden. Using
val lets us not shadow the value attribute, and also mirrors jQuery so
the concept shouldn't be foreign to developers.