12 lines
419 B
JavaScript
12 lines
419 B
JavaScript
{16d882b7fc4a0bf2d5bd903067620c78834d7903 true 419 main.js 0xc0030cca10}
let btnEl = document.querySelector('.generate');
|
|
let serialEl = document.querySelector('.serial');
|
|
|
|
btnEl.onclick = function(){
|
|
let chars = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
let charsCount = 15;
|
|
let randomSerial = "";
|
|
for (let i = 0; i < charsCount; i++){
|
|
randomSerial += chars[Math.floor(Math.random() * chars.length)];
|
|
}
|
|
serialEl.innerHTML = randomSerial;
|
|
}; |