How to make it when i click add and submit it will show out the weather icon | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

How to make it when i click add and submit it will show out the weather icon

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

1st Oct 2020, 6:12 AM
Kyrene
14 Réponses
+ 5
Kyrene The reason why icon in not showing is that you store the value of the element by doing gelElemetById().value [that icon is because of id ] You should store a whole element OR create a var for id & append new element with that id to the table
1st Oct 2020, 7:20 AM
Twaatii
Twaatii - avatar
+ 4
Create a variable for selecting the id/class for that font-awesome & append the class then 👍
1st Oct 2020, 7:02 AM
Twaatii
Twaatii - avatar
+ 3
Kyrene please separate the html and js code so that I will understand 🤔
1st Oct 2020, 7:20 AM
LIONEL
LIONEL - avatar
+ 3
Kyrene You should see the DOM & Events Lessons of JavaScript of SoloLearn then you will get the concept 👍 https://www.sololearn.com/learn/JavaScript/2755/
1st Oct 2020, 7:25 AM
Twaatii
Twaatii - avatar
+ 2
Use Array 👍
1st Oct 2020, 8:15 AM
Twaatii
Twaatii - avatar
+ 2
Kyrene You should create only one weather variable no matters how many time u declare that var the value is gonna be only one ie.last one
1st Oct 2020, 8:17 AM
Twaatii
Twaatii - avatar
+ 1
Em please can you explain the problem very well...I am confused 😁
1st Oct 2020, 7:09 AM
LIONEL
LIONEL - avatar
+ 1
When i click the radio button then add and submit,the table of weather will show out the weather icon not a text
1st Oct 2020, 7:11 AM
Kyrene
+ 1
😭
1st Oct 2020, 7:19 AM
Kyrene
+ 1
So i need to Correction all of this? var weather=document.getElementById ('w').value; var weather=document.getElementById ('a').value; var weather=document.getElementById ('b').value; var weather=document.getElementById ('c').value; var weather=document.getElementById ('d').value; var weather=document.getElementById ('e').value; var weather=document.getElementById ('f').value; var weather=document.getElementById ('g').value; var weather=document.getElementById ('h').value; var weather=document.getElementById ('i').value;
1st Oct 2020, 8:05 AM
Kyrene
+ 1
Kyrene Yeah 👍🤟
1st Oct 2020, 8:11 AM
Twaatii
Twaatii - avatar
+ 1
How to store all the element together?
1st Oct 2020, 8:13 AM
Kyrene
0
I am seriously trying to understand the function of the add button 🤔🤔🤔
1st Oct 2020, 7:16 AM
LIONEL
LIONEL - avatar
0
I separate it already
1st Oct 2020, 8:10 AM
Kyrene