如何使用jQuery设置DropDownList的值? [英] How can I set the value of a DropDownList using jQuery?

查看:138
本文介绍了如何使用jQuery设置DropDownList的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是,如何使用jQuery设置DropDownList控件的值?

解决方案

  $( #mydropdownlist)VAL( thevalue); 

只需确保选项标签中的值与val方法中的值相匹配。


As the question says, how do I set the value of a DropDownList control using jQuery?

解决方案

$("#mydropdownlist").val("thevalue");

just make sure the value in the options tags matches the value in the val method.

这篇关于如何使用jQuery设置DropDownList的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆