Advertisement
jermartyno

generatorliczb.pl: Blacklisting certain strings

Mar 11th, 2022
1,587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const button_ccvar = document.getElementsByClassName('block generate-numbers')[0];
  2. const result_tbvar = document.getElementById('result-numbers');
  3. const blacklisted_strings = ['21', '24']
  4.  
  5. function changeText(text) {
  6.   if (blacklisted_strings.includes(result_tbvar.textContent)) {
  7.     result_tbvar.textContent = text;
  8.   }
  9. }
  10.  
  11. button_ccvar.addEventListener('click', () => changeText(document.getElementById('to').value));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement