шифровка алексу
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<div class="search2">
<input type="number" min="0" max="100" name="brouser[0]" id="brouser" value="0"> % <label for="brouser-1">Internet Explorer</label><br />
<input type="number" min="0" max="100" name="brouser[1]" id="brouser" value="30"> % <label for="brouser-2">FireFox</label><br />
<input type="number" min="0" max="100" name="brouser[2]" id="brouser" value="20"> % <label for="brouser-3">Google Chrome</label><br />
<input type="number" min="0" max="100" name="brouser[3]" id="brouser" value="30"> % <label for="brouser-4">Opera</label><br />
<input type="number" min="0" max="100" name="brouser[4]" id="brouser" value="5"> % <label for="brouser-5">Safari</label><br />
<input type="number" min="0" max="100" name="brouser[5]" id="brouser" value="3"> % <label for="brouser-6">Mobile</label><br />
<input type="number" min="0" max="100" name="brouser[6]" id="brouser" value="7"> % <label for="brouser-7">Прочие браузеры</label><br />
<span class="warning2">Сумма должна быть равной 100!</span>
</div>
<input type="submit" onclick="rnd(100)" value="заполнить ✎">
<script>
function rnd(h) {
var e = document.querySelectorAll(".search2 input"),
g = function(f, c) {
for (var d = [], a = 0; a < f - 1; a++) {
var b;
c ? (b = c, b = Math.floor(Math.random() * (b + 1))) : b = 0;
c -= b;
d[a] = b
}
d.push(c);
for (a = d.length - 1; 0 < a; a--) {
b = Math.floor(Math.random() * (a + 1));
var e = d[b];
d[b] = d[a];
d[a] = e
}
return d
}(e.length, h),
f = 0;
[].forEach.call(e, function(e, c) {
e.value = g[c];
f += g[c]
});
alert(f)
};</script>
</body>
</html>