I have been working on a bootstrap selectpicker and I am trying to add a placeholder text inside the search input area that says Search here. However, my current methods do not seem to be effective.
I attempted to use this script, but it did not produce the desired result:
$(".selectpicker").selectpicker({
liveSearchPlaceholder: "Placeholder text"
});
If anyone has any suggestions or solutions, please share them with me!
Here is part of the code snippet for reference:
$(".selectpicker").selectpicker({
liveSearchPlaceholder: "Search here.."
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="74161b1b0007000615045907111811170034455a45475a4540">[email protected]</a>/dist/css/bootstrap-select.min.css">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ed8f8282999e999f8c9dc09e8881888e99addcc3dcdec3dcd9">[email protected]</a>/dist/js/bootstrap-select.js"></script>
<select class="selectpicker" data-show-subtext="false" data-live-search="true" style="-webkit-appearance: none;" data-live-search-placeholder="Search" >
<option value="" disabled selected class="disabled"></option>
<option value="ExhibitionPreparation">Exhibition Preparation</option>
<option value="Onlineserviceorderplatformandformssubmission">- Online service order platform and forms submission</option>
<option value="StandconstructionMachineandExhibitsetupmatters">- Stand construction. Machine and Exhibit set up matters</option>
</select>