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

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

问题描述

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

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

推荐答案

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

只要确保 options 标签中的值与 val 方法中的值匹配即可.

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

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

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