html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<script>
let sectNum = [],
sectNumPC = [],
sectNumRadom = [],
constQTD = 10,
constSTART = 10,
constEND = 20;
function compArray(arr1, arr2){
let on = [];
for(let v in arr1)
if(arr1[v]==arr2[v]) on.push(arr2[v]);
return on;
}
function radomArray(lenghtIn=constSTART, lenghtOf=constEND, qtd=constQTD){
let out = [];
if(lenghtOf<lenghtIn) return Error('Value limit is less than start');
else if((lenghtOf-lenghtIn)<qtd) return Error('The number of items cannot be greater than the range');
else{
while(out.length<qtd){
let item = Math.floor(lenghtIn+Math.random()*lenghtOf);
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
html {
line-height: 1.5;
font-family: "Roboto", sans-serif;
font-weight: normal;
color: rgba(0,0,0,0.87);
}
input{
width: 100px;
border: 0;
padding: 5px;
margin-right: 5px;
}
input:invalid {
color: red;
text-indent: 10px;
-webkit-box-shadow: inset 0px 1px 5px 0px rgba(153, 0, 0);
-moz-box-shadow: inset 0px 1px 5px 0px rgba(153, 0, 0);
box-shadow: inset 0px 1px 5px 0px rgba(153, 0, 0);
}
input:valid {
color: green;
text-indent: 10px;
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run