- Insert xml to <select>
- <Questions>
- <Question>
- <Id>1</Id>
- <Text>aaa</Text>
- <Reserver />
- </Question>
- <Question>
- <Id>2</Id>
- <Text>bbb</Text>
- <Reserver />
- </Question>
- </Questions>
- $(doc).find("Questions").each(function()
- {
- $('#s').
- append( $("<option></option>").
- attr("value",$(this).find('Text').text()).
- text($(this).find('Text').text()));
- });
- <select id="s">
- <option></option>
- </select>