9 thoughts on “JavaScript List Example [ Select and Option ]

  • April 8, 2019 at 16:39
    Permalink

    hi.. since u instantiated var x = f.hobby.options,

    could your if statement not be simplfied to something like

    if(x[i].selected) ??

    was just wondering.. since you only actually used x variable for the for statement, you might as well use it in the if statement as well?

  • April 8, 2019 at 16:39
    Permalink

    Hello I'm glad you took your time to answer my question 

    The thing is I want to add a value and calculations  to the 'selected options' using JavaScript 

    E.g if a person selects FROM : Cape town (10KM )TO : BELVIVL (40KM ) 

    It will cost him $10 everytime he travels for 10 KM 
    And if he's an adult it wil, cost him twice as more as compared to what a child would pay 

    I hope sound a bit clear now

  • April 8, 2019 at 16:39
    Permalink

    hi there hope you well
    I was wondering if you could help me with a bit of
    programming I'm using JavaScript im building a train app ,
    where users can purchase their tickets online , select their
    options and choose their destination .. the problem is I'm try
    to make a selection options;from___ and to__ on my app (in
    which I'm working on)…

Leave a Reply