[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
i should use it inside function?Jeanne Boyarsky wrote:Do you know how to get an element by ID in JavaScript? That will let you get the value.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
i try thisJeanne Boyarsky wrote:This isn't right:
document.getElementsByTagName("option")[x].value
Hint: You want to get the element by id. (which means you need to add an id)
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:You still don't have the write syntax. Try doing a console.log of your expression to get the value so you can see that you are getting a JavaScript syntax error there.
ok.In this case how should have been writen?Bear Bibeault wrote:Randomly trying different things with the wrong syntax isn't going to get you anywhere fast. You need to step back and learn the basic syntax of JavaScript before trying to write code like this.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
you tell me that i have a wrong sentence i have try everything i have look everywhere but nothing .i can make a link to another page but i want to be the link given by user .I havent find nothing to related by this.I am learning from w3school.I dont know what basic needs windows.location or what i am doing wrong.Only this is a question you can tell me and i will learn it .Easy it is i beleive .It isnt something so confused .My mind is not working .I have done many exercices from morning so. I stuck here .If not give me answer its ok if yes you will get me out of a work from hourJeanne Boyarsky wrote:What website or article are you using to learn about JavaScript? If none, what did you Google to try to find one?
We want to help you learn. That isn't going to come from handing you the syntax.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Jeanne Boyarsky wrote:Forget about window.location for a minute. This is not right:
(x =document.getElementsById
That's not related to the problem you are trying to solve. It is basic JavaScript. Which page on w3schools taught you to write that code? I agree with Bear that you need a basic JavaScript tutorial. You won't learn it from copy/pasting code that I write.
If the problem is that you are tired and your "mind isn't working", the best thing to do is to step away from the problem and come back to it later (or Monday.)
I'm gonna teach you a lesson! Start by looking at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|