Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,201,426 members, 7,978,348 topics. Date: Friday, 18 October 2024 at 06:43 AM |
Nairaland Forum / Science/Technology / Programming / Javascript Issue (1100 Views)
Whats An Easy Solution To This Javascript Issue / Challenge For Javascript Beginners/intermidiate / After 10days Of Coding With Html, Css And Javascript Forum4africa Is Ready (2) (3) (4)
Javascript Issue by babajeje123(m): 11:45am On Dec 29, 2020 |
Can someone please help me to look at these code? |
Re: Javascript Issue by babajeje123(m): 11:47am On Dec 29, 2020 |
Nairaland is preventing me from posting the code |
Re: Javascript Issue by Csami(m): 12:18pm On Dec 29, 2020 |
babajeje123: Snap and post |
Re: Javascript Issue by Karleb(m): 12:22pm On Dec 29, 2020 |
Take screen shot with your computer and post here. |
Re: Javascript Issue by babajeje123(m): 5:05pm On Dec 29, 2020 |
Okay, see this. It is not working.
|
Re: Javascript Issue by babajeje123(m): 5:08pm On Dec 29, 2020 |
Whereas, this is working.
|
Re: Javascript Issue by babajeje123(m): 5:09pm On Dec 29, 2020 |
They are the same but performing different tasks. |
Re: Javascript Issue by Karleb(m): 5:15pm On Dec 29, 2020 |
babajeje123: Oga! getElementById will only pick one tag. Use getElementsByClassName to get all the inputs in first picture. Advice. Look into let and const keywords. Try to know about code indentation. 1 Like |
Re: Javascript Issue by babajeje123(m): 5:19pm On Dec 29, 2020 |
Karleb:I used notepad as text editor, reason why the code is not well indented |
Re: Javascript Issue by Karleb(m): 5:27pm On Dec 29, 2020 |
babajeje123: Sublime text is only 10mb. Coding with notepad is torture. 4 Likes |
Re: Javascript Issue by Pearlbaby(m): 7:13pm On Dec 29, 2020 |
babajeje123:For the checkColours function, you used getElementbyID but you are getting the name instead. |
Re: Javascript Issue by etoluw: 8:25pm On Dec 29, 2020 |
babajeje123: you did not add value attribute to them e.g <input type="radio" name="colours" id="purple" value="purple" > Purple 1 Like |
Re: Javascript Issue by heyiamjosh(m): 10:02pm On Dec 29, 2020 |
Obviously, this code won't work. Your issues; 1. You're getting element by id but you're putting name, 2. getElementById does not return an array. So therefore, your for loop won't work and, 3. Your inputs does not have values 1 Like |
Re: Javascript Issue by sholarr12: 11:39am On Dec 30, 2020 |
babajeje123: Karleb:I don't know if you could help too. Could you please help with this JavaScript code asking me to return a string/statement?:
|
Re: Javascript Issue by Karleb(m): 12:00pm On Dec 30, 2020 |
sholarr12:
|
Re: Javascript Issue by sholarr12: 12:06pm On Dec 30, 2020 |
Thank you very much. I have been able to do it with your help. It was basically the omission of the semi colon to signal the end of each line that was the issue I guess! Thank you, sir.
|
Re: Javascript Issue by Karleb(m): 12:16pm On Dec 30, 2020 |
sholarr12: These days, semicolons are optional in Javascript. Try to break your code into multiple lines though. It's easier to read that way. |
Re: Javascript Issue by sholarr12: 12:22pm On Dec 30, 2020 |
Karleb:I copied it from your help already. See:
|
(1) (Reply)
Companies Job Requirements Sometimes Are Unbelievable... On Linkedin / I Have Succumbed To The Pressure!! / I'm Doing This For The Money
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17 |