Add min, max option to support restrict value to a particular range

see the last example in index.html