populating a drop down menu with xml file

后端 未结 2 1062
抹茶落季
抹茶落季 2021-02-10 01:32

I have the following code which is loading an xml file to populate a dropdown menu. Right now the value equals the option text but I would like to have the value equal to some n

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-10 02:15

    Not sure really what you are asking, but you could do 1 of two things.

    Have a count variable in the javascript and everytime you add an option increment this variable. Use that number as the "value" and it will correspond to its "point" in the XML.

    Or in the xml do each "make" like this:

    
        1
        Ford
    
    

    and use the ID.

    Not sure what you really want though, so don't know if this will help.

提交回复
热议问题