Input type, attr vs prop
Input type, attr vs prop
Hi,
I'm trying to use customized types on input element for further validation using the pattern property.
HTML:
<input id="metric" type="inches">
JS:
$('input').prop('type') -> "text"
$('input').attr('type') -> "inches"
My question is, is this the expected result ? Even with the new HTML5 types, like "number", prop function returns "text" as type.
I clearly have a solution where, I should rely on attr function.