Skip to content

Instantly share code, notes, and snippets.

@bentinata
Created July 17, 2018 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bentinata/d41e54ee9384df1709767fc0066a3ae0 to your computer and use it in GitHub Desktop.
Save bentinata/d41e54ee9384df1709767fc0066a3ae0 to your computer and use it in GitHub Desktop.
function generate (min, max) {
document.querySelectorAll('#rounded-corner>tbody>tr').forEach((e, i) => {
const n = Math.floor(Math.random() * (max - min + 1)) + min;
const q = `#K${(i + 1).toString().padStart(2, 0)}${Math.ceil(n / 3)}${((n - 1) % 3 + 1)}`
document.querySelector(q).checked = true;
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment