<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) );

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js