jquery如何让select指定的选项被选中

2024-10-15 08:09:46

1、新建一个html文件,命名为test.html,用于讲解jquery如何让select指定的选项被选中。

jquery如何让select指定的选项被选中

3、在script标签内,通过id获得第二个option对象,使用attr()方法将“衡痕贤伎selected”属性值设置为“selected”。

jquery如何让select指定的选项被选中
猜你喜欢