Home > Web Front-end > HTML Tutorial > 怎么给控件select动态添加option选项_html/css_WEB-ITnose

怎么给控件select动态添加option选项_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:27:07
Original
1603 people have browsed it

<select id="myselect">	<option value="1">aaa</option>	<option value="2">bbb</option>	<option value="3">ccc</option>	<option value="4">ddd</option>	<option value="5">eee</option>	<option value="6">fff</option></select>
Copy after login


上面这张select控件么,如果里面的option选项我需要在通过ajax获取到数据后再添加,该怎么实现啊?

var Child = $("#myselect").children().last();
Child.append("");
这样子添加不对呀。
求高手指教。


回复讨论(解决方案)

$("#myselect").append("");

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template