gpt4 book ai didi

javascript - 如何覆盖这个文本?

转载 作者:太空宇宙 更新时间:2023-11-04 15:53:57 25 4
gpt4 key购买 nike

我正在使用 Bootstrap-select CDN: https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/js/bootstrap-select.min.js

在此 CDN 文件中存在文本“未选择任何内容”。我想更改文件中的这段文本。当然,我可以下载这个 js 文件并更改文本。但我想使用cdn。

有 JavaScript 代码可以做到这一点吗?

我尝试使用:

jQuery(document).ready(function($) { 
$('.propertyforsale-search .bootstrap-select.btn-group .dropdown-toggle .filter-option span.filter-option.pull-left').html('You Should Select an item');

})(jQuery);

我的html:

<button type="button" class="btn dropdown-toggle bs-placeholder btn-default" data-toggle="dropdown" role="button" data-id="tax_mylanguages" title="Nothing selected" aria-expanded="false"><span class="filter-option pull-left">Nothing selected</span>&nbsp;<span class="bs-caret"><span class="caret"></span></span></button>

最佳答案

你可以用title来做到这一点属性 <select>用于初始化 noneSelectedText 选项的标记。关于 github 的整个文档.

<select class="selectpicker" multiple title="Choose one of the following...">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>

或者您可以使用下面的编程方式来完成:

$('.selectpicker').selectpicker({
noneSelectedText:"Choose one of the following..."
});

Skilling of use the third party libraries

this skilling often works fine for myself,so I tell it to you.

  • first to see the source that whether existing a copyright doc,because it often contains the documentation location,e.g:Bootstrap-select v1.12.1 (http://silviomoreto.github.io/bootstrap-select).
  • if not existing a copyright doc,you could give a try to google with keyword of the library to find out the documentation.
  • quickly to see the third part examples,if it provided.
  • understand the third party library deeply via its api/documentation.

关于javascript - 如何覆盖这个文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42870523/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com