Hey do anyone know why the if statement in func() of class cards is not working properly? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

Hey do anyone know why the if statement in func() of class cards is not working properly?

https://code.sololearn.com/Wa9gFiGl92rC/?ref=app

19th Mar 2023, 7:34 AM
Vasu Mallik
2 Antworten
+ 1
The variables (_3, _4, previous_div, previous_para) are assigned the value of the HTMLElement property innerText, a string, not the HTMLObject itself. So when it comes time to assign the innerText of the HTMLParagraph elements with the desired data(the two cards picked and the first card's div id and paragraph id), it does not happen because the variables(_3, _4, previous_div, previous_para) are strings and HTMLobjects. For example at line 74 " _3 = a1; " should be "document.getElementById('p14').innerText = a1;" or something to this effect. I suggest the same for lines 75, 75, 82, 90, and 93.
19th Mar 2023, 9:46 PM
ODLNT
ODLNT - avatar
+ 1
ODLNT THANK U IT REALLY WORKED
20th Mar 2023, 3:00 AM
Vasu Mallik