Using .prop('type') instead of .attr('type') to detect input types.