Guest User

Untitled

a guest
Jan 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. for(var x = 0; x < 5; i++) {
  2.  
  3. var sel1 = document.querySelector('#sel1');
  4. var sel2 = document.querySelector('#sel2');
  5. var options2 = sel2.querySelectorAll('option');
  6.  
  7. function giveSelection(selValue) {
  8. sel2.innerHTML = '';
  9. for(var i = 0; i < options2.length; i++) {
  10. if(options2[i].dataset.option === selValue) {
  11. sel2.appendChild(options2[i]);
  12. }
  13. }
  14. }
  15.  
  16. giveSelection(sel1.value);
  17.  
  18. }
  19.  
  20. var a="sel" + i;
  21.  
  22. var b="sel" + i;
  23.  
  24. var c="options" + i;
Add Comment
Please, Sign In to add comment