Back



Fill a table with random values every second

# A B
1 - -
2 - -
3 - -


Source of exampleCopy to clipboard


/** Short alias for AvalynxRef */
class AR extends AvalynxRef {
	constructor(selector, options = {}) {
		super(selector, options);
	}
}

const a1 = new AR('#a1');
const b1 = new AR('#b1');
const a2 = new AR('#a2');
const b2 = new AR('#b2');
const a3 = new AR('#a3');
const b3 = new AR('#b3');
a1.value = Math.floor(Math.random() * 100);
b1.value = Math.floor(Math.random() * 100);
a2.value = Math.floor(Math.random() * 100);
b2.value = Math.floor(Math.random() * 100);
a3.value = Math.floor(Math.random() * 100);
b3.value = Math.floor(Math.random() * 100);

/** Random value generator */
setInterval(() => {
	a1.value = Math.floor(Math.random() * 100);
	b1.value = Math.floor(Math.random() * 100);
	a2.value = Math.floor(Math.random() * 100);
	b2.value = Math.floor(Math.random() * 100);
	a3.value = Math.floor(Math.random() * 100);
	b3.value = Math.floor(Math.random() * 100);
}, 1000);
	
AvalynxRef on GitHub Avalynx on GitHub