I'm writing some validation for a form which includes an tag with type="number". If non-numeric text is entered in the input box, getting the element with javascript and checking the value returns an empty string (in Chrome and Firefox at least).
var input = document.getElementById('inputId');
// -> <input type="number" id="inputId">
console.log('The value is: ', input.value);
// -> The value is:
console.log(typeof inputs.value);
// -> string
Is there a way to get whatever is in the input if the entered text doesn't match the input's "type" attribute?