如何清除选择框 [英] How to clear the select boxes

查看:72
本文介绍了如何清除选择框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这将是一个简单的答案,我使用了选择的下拉列表来过滤记录.我添加了另一个按钮来重置过滤器值.

I am hoping this will be a simple answer, I have used chosen drop downs for filtering the records. I have added another button for reseting the filter values.

我要清除重置"点击上的选定下拉列表.

I want to clear the chosen drop down on the "Reset" click.

我确实尝试更改选定的值,但是没有运气.

I did try changing the selected values, but no luck.

有指针吗?

推荐答案

最后得到了我的问题的答案,这是在 GitHub for Choosen 插件.

Finally got answer to my question, it was asked in the GitHub for Choosen plugin.

这是类似于魅力的代码:-

Here is the code that works like charm:-

          $('.dropdownclass option:selected').removeAttr('selected');
          $('.dropdownclass').trigger('chosen:updated');

希望这会有所帮助.

这篇关于如何清除选择框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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