javascript - Will have option to show the image instead of selected text in bootstrap multiselect -


whether have option here show image default.

code:

 <select id="example-post" style="width:120px;!important;" class="footerselect" name="multiselect[]" multiple="multiple">                                             <option value="1">test</option>                                             <option value="2">test1</option>                                             <option value="3">test2 </option>              

 $('.multiselect-selected-text').text('options'); 

enter image description here

here instead of options want show image default.

try this...

<div class="pull-left">     <div class="pull-right">         <div class="btn-group">                                  <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">                     <span>actions</span>                     <span class="caret"></span>                 </a>                 <ul class="dropdown-menu">                     <li class="ok"><a href="#">item 1</a></li>                     <li><a href="#">item 2</a></li>                     <li class="ok"><a href="#">item 3</a></li>                     <li class="divider"></li>                     <li><a href="#">item 4</a></li>                     <li><a href="#">item 5</a></li>                  </ul>             </div>     </div> </div>  @import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');  .container {     margin-top: 10px; }  .dropdown-menu li:nth-of-type(1) {      background-image: url("http://files.softicons.com/download/application-icons/32x32-free-design-icons-by-aha-soft/png/32/color%20test.png") !important;      background-repeat: no-repeat;     background-size: 16px 16px;     background-position: 3px 5px;     padding-left: 5px; }  .dropdown-menu li:nth-of-type(2) {      background-image: url("http://files.softicons.com/download/application-icons/32x32-free-design-icons-by-aha-soft/png/32/color%20test.png") !important;      background-repeat: no-repeat;     background-size: 16px 16px;     background-position: 3px 5px;     padding-left: 5px; } 

Comments