jquery如何给select添加id属性

2024-10-14 11:00:24

1、新建一个html文件,命名为test.html,用于讲解jquery如何给select添加id属性。

jquery如何给select添加id属性

3、在script标签内,通过元素名称获得select对象,使用attr()方法给select添加一个值为"mytest"的id属性。

jquery如何给select添加id属性
猜你喜欢