Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1.  
  2. function populate() {
  3. var seria = document.getElementById("seria");
  4. var wartosc = seria.options[seria.selectedIndex].value;
  5. var zadanie = document.getElementById("zadanie");
  6. while (zadanie.firstChild) {
  7. zadanie.removeChild(zadanie.firstChild); }
  8. var nazwy;
  9. if (wartosc == "Wektory") {
  10. nazwy = ["Departures", "Fraction", "Intersection"]; }
  11. else if (wartosc == "Lancuchy") {
  12. nazwy = ["Colloquium", "Initials", "Sort"]; }
  13. else if (wartosc == "Algorytmy") {
  14. nazwy = ["Duplicates", "Find"]; }
  15. else if (wartosc == "Klasy") {
  16. nazwy = ["Bottle", "Lights", "Set", "Triangle"]; }
  17. else if (wartosc == "Operatory") {
  18. nazwy = ["Add", "Geometric"]; }
  19. else if (wartosc == "Metody") {
  20. nazwy = ["Histogram", "Object"]; }
  21. else if (wartosc == "Kolokwium") {
  22. nazwy = ["K11", "K12", "K13", "K14"]; }
  23. var opcja = document.createElement("option");
  24. opcja.value = "";
  25. opcja.innerHTML = "";
  26. zadanie.appendChild(opcja);
  27. for (var index = 0; index < nazwy.length; index++) {
  28. var opcja = document.createElement("option");
  29. opcja.value = nazwy[index];
  30. opcja.innerHTML = nazwy[index];
  31. zadanie.appendChild(opcja); }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement