JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
</head>
<body style="font-size:62.5%;">
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
<div id="slider"></div>
</body>
</html>
CSS
#slider { margin: 10px; }
JavaScript
function addCommas(numberString) {
var resultString = numberString + '',
x = resultString.split('.'),
x1 = x[0],
x2 = x.length > 1 ? '.' + x[1] : '',
rgxp = /(\d+)(\d{3})/;
while (rgxp.test(x1)) {
x1 = x1.replace(rgxp, '$1' + ',' + '$2');
}
return x1 + x2;
}
$(function() {
$( "#slider" ).slider({
value:100,
min: 0,
max: 5000000000,
step: 1,
slide: function( event, ui ) {
$( "#amount" ).val( "£" + addCommas(ui.value) );
}
});
$( "#amount" ).val( "£" + $( "#slider" ).slider( "value" ) );
});