<strong>Дробное число:</strong> <span id="_1"></span><br/>
<strong>Целое число:</strong> <span id="_2"></span>
body {
font: 11pt Verdana, Tahoma, sans-serif;
line-height: 1.5;
}
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
$('span#_1').text( getRandomArbitrary(1, 10) );
$('span#_2').text( getRandomInt(1, 10) );
This Pen doesn't use any external CSS resources.