Hatkat

English Code Lesson

Jun 13th, 2022 (edited)
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Jonathan Ordoñez
  2. // Verificar consola para ver respuestas - No Auto
  3.  
  4. let div = document.getElementById('capa1');
  5. let divs = div.getElementsByTagName('div');
  6.  
  7. function GetID(Ans, Index) {
  8.     let eeoo = ""
  9.     let noable = ["join", "drop"]
  10.     if (!Ans.includes(":")) {
  11.         return null
  12.     }
  13.  
  14.     let Type = Ans.split(":")[0]
  15.     eeoo = noable.includes(Type) == true ? "" : "able"
  16.     return Type + `${eeoo}div${Index}`
  17. }
  18.  
  19. for (let i = 0; i < contenidoaguardar.length; i++) {
  20.     let Element = GetID(contenidoaguardar[i][0], i)
  21.     Element = document.getElementById(Element)
  22.     if (Element == null) {
  23.         Element = document.getElementById(`textbox${i}`) || document.getElementById(`selectbox${i}`)
  24.     }
  25.  
  26.     console.log(contenidoaguardar[i][0], Element)
  27. }
Add Comment
Please, Sign In to add comment