Inline range validation

Inline range validation

This works for me

<input id="foo" name="foo" type="text" class="required" />

But I want range validation as well, something like this:

<input id="foo" name="foo" type="text" class="required range[1900:2100]" />

Is this possible? What is the correct syntax?