JSFiddle - React, Tailwind, and code Playground
by AndreaLigios
HTML
<script src="http://tjvantoll.com/images/posts/2012-07-15/dependencies.js"></script>
<link rel="stylesheet" href="http://tjvantoll.com/images/posts/2012-07-15/dependencies.css">
AAA
<h3>Currency - USD</h3>
$ <input type="number" min="0.01" step="0.01" max="2500" value="25.67" />
CSS
body { padding: 5px; }
h3:first-child { margin-top: 0; }
h3 { margin-top: 10px; margin-bottom: 2px; }
JavaScript
$('input[type="number"]').change(function() {
var min = Globalize.parseFloat($(this).attr("min"));
var max = Globalize.parseFloat($(this).attr("max"));
var value = Globalize.parseFloat($(this).val());
if(value < min) { value = min; }
if(value > max) { value = max; }
$(this).val(value);
//value = Globalize.format(value,"c");
console.log(value);
});