Due our comments in the main post, the only choice is javascript.
According with your original HTML:
<input type="text" value="" class="text-box number">
<input type="text" value="" class="text-box email">
<input type="text" value="" class="text-box tel">
I can make some changes (for example, add a data-type
custom attribute, see the following HTML) and then the javascript block:
$(document).ready(function() {
// iteration through all elements that matches
$('.text-box[data-type]').each(function() {
//replace the type
$(this).attr('type', $(this).attr('data-type'));
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<input type="text" value="" data-type="number" class="text-box">
<input type="text" value="" data-type="email" class="text-box">
<input type="text" value="" data-type="tel" class="text-box">
This will not work in IE9 or less since it doesn't allow to change dynamically the type of an input, but in the rest of browsers it will work perfectly.