Advertisement
ignacy123

Olek js

Jun 8th, 2024
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. let BMW_modele = ['1M', '3GT', 'i8', 'iX2', 'Seria 5', 'X7']
  2. let Mercedes_lista = ['AMG GT', 'Citan', 'CLA', 'CLE', 'EQA', 'EQB', 'EQC', 'EQE']
  3. var modeleAudi = ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'e-tron']
  4. var modeleToyota = ['Yaris', 'Yaris Cross','Corolla TS Kombi','Corolla Sedan','C-HR','C-HR Plug-in Hybrid','bZ4X','Prius']
  5. var modeleHonda = ['Jazz', 'Civic', 'HR-V', 'Accord', 'Prelude', 'CRX']
  6. var moOpel = ["Corsa", 'Astra', 'Insignia', "Grandlan X"]
  7. let nice = document.getElementById("gotowe")
  8. let BMW_l = document.getElementById("BMW")
  9. let modele = document.getElementById("modele")
  10. let opel = document.getElementById("Opel")
  11. let Toyota = document.getElementById("Toyota")
  12. let Mercedes = document.getElementById("Mercedes")
  13. let Honda = document.getElementById("Honda")
  14. let Audi = document.getElementById("Audi")
  15. let r = document.getElementById("r")
  16. BMW_l.onclick = function() {
  17.  
  18. modele.innerHTML = ''
  19.  
  20. BMW_modele.forEach(function(optionText) {
  21. let option = document.createElement('option');
  22. option.text = optionText
  23. modele.appendChild(option);
  24. });
  25. }
  26. opel.onclick = function() {
  27.  
  28. modele.innerHTML = ''
  29.  
  30. moOpel.forEach(function(optionText) {
  31. let option = document.createElement('option');
  32. option.text = optionText
  33. modele.appendChild(option);
  34. });
  35. }
  36.  
  37. Toyota.onclick = function() {
  38.  
  39. modele.innerHTML = ''
  40.  
  41. modeleToyota.forEach(function(optionText) {
  42. let option = document.createElement('option');
  43. option.text = optionText
  44. modele.appendChild(option);
  45. });
  46. }
  47. Mercedes.onclick = function() {
  48.  
  49. modele.innerHTML = ''
  50.  
  51. Mercedes_lista.forEach(function(optionText) {
  52. let option = document.createElement('option');
  53. option.text = optionText
  54. modele.appendChild(option);
  55. });
  56. }
  57. Honda.onclick = function() {
  58.  
  59. modele.innerHTML = ''
  60.  
  61. modeleHonda.forEach(function(optionText) {
  62. let option = document.createElement('option');
  63. option.text = optionText
  64. modele.appendChild(option);
  65. });
  66. }
  67. Audi.onclick = function() {
  68.  
  69. modele.innerHTML = ''
  70.  
  71. modeleAudi.forEach(function(optionText) {
  72. let option = document.createElement('option');
  73. option.text = optionText
  74. modele.appendChild(option);
  75. });
  76. }
  77. r.onclick = function() {
  78. modele.innerHTML = ''
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement