Home  >  Article  >  Web Front-end  >  ASP.NET jQuery 实例8 (动态添加内容到DropDownList)_jquery

ASP.NET jQuery 实例8 (动态添加内容到DropDownList)_jquery

WBOY
WBOYOriginal
2016-05-16 17:56:421133browse

首先准备好页面代码:

复制代码 代码如下:





选择颜色















 








 

 









主要通过jQuery的append方法动态添加内容,脚本代码如下:
复制代码 代码如下:


Recipe8





最终显示效果如下:


动态添加内容还可以通过以下方式添加:
$("#ddlSecond").append($("").val("31").html("蓝色1"));
Statement:
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