Bootstrap下拉按钮的名称在单击时发生更改 [英] Bootstrap Dropdown Button names change when clicked

查看:303
本文介绍了Bootstrap下拉按钮的名称在单击时发生更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用下拉按钮(4个按钮)来过滤我的项目中的内容,并且我希望按钮名称更改为选定的名称,以便用户不会忘记他/她在哪里.见图.

I'm using dropdown buttons (4 buttons) to filter my content in my project, and i want that the button names change to the selected, so the user will not forget where he/she is. See figure.

这怎么可能?

提前谢谢,这是 pen .

推荐答案

您可以使用jQuery更新下拉按钮文本.

You can use jQuery to update the dropdown button text..

$(".dropdown-menu li a").click(function(){
  $(".btn:first-child").html($(this).text()+' <span class="caret"></span>');
});

Bootply演示: http://bootply.com/75849

Bootply demo: http://bootply.com/75849

这篇关于Bootstrap下拉按钮的名称在单击时发生更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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