英文:
Set default to Not Selected Bootstrap country picker
问题
I'm here to provide the translated content. Here's the translated part of your text:
使用Bootstrap国家选择器,我正在使用下面的代码来填充国家列表。它可以正常工作,但没有默认的“未选择”选项。是否有解决方法...?
<script>
$('.countrypicker').countrypicker();
</script>
<select class="form-control selectpicker countrypicker" id="country" name="country" data-flag="true" data-default=""></select>
英文:
With Bootstrap country picker, I am using the code below to populate countries. Its working fine but there is no "Not Selected" default. Is there a work around for this...?
<script>
$('.countrypicker').countrypicker();
</script>
<select class="form-control selectpicker countrypicker" id="country" name="country" data-flag="true" data-default=""></select>
答案1
得分: 2
如果你想更改文本 'Nothing Selected',请将标题属性设置为你需要的内容。
例如:title="My Custom Text"
<select class="form-control selectpicker countrypicker" id="country" name="country" data-flag="true" title="My Custom Text"></select>
<button>添加选项</button>
英文:
If you want to change the text 'Nothing Selected', set the title property to whatever you need.
eg: title="My Custom Text"
<select class="form-control selectpicker countrypicker" id="country" name="country" data-flag="true" title="My Custom Text"></select>
<button>Add option</button>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论