html下拉框占位,引导select下拉列表占位符
是的,只是“select禁⽤”的选项。
Please selectABC
链接到⼩提琴
您也可以查看答案
使⽤隐藏:
Display but don't show in list text 1 text 2 text 3
下拉或select没有占位符,因为HTML不⽀持它,但可以创build相同的效果,所以它看起来像其他input占位符相同
$('select').change(function() { if ($(this).children('option:first-child').is(':selected')) { $(this).addClass('placeholder'); } else { $(this).removeClass('placeholder'); } });
.placeholder{color: grey;} select option:first-child{color: grey; display: none;} select option{color: #555;} /
/ bootstrap default color
Your Placeholder TextText 1Text 2Text 3
尝试这将⼯作更好:)
<
当使⽤required + value=""⽤户不能使⽤hidden的选项将其隐藏,从选项列表中隐藏,当⽤户打开选项框
试试@title =“东西”。 它为我⼯作。
使⽤Bootstrap,这是你可以做的。 使⽤类“⽂本隐藏”,禁⽤选项将⾸先显⽰,但不在列表中。
TitleABC
添加隐藏属性:
Please selectABC
这是另⼀种⽅法
Choose PlatformiOSAndroidWindows
“select平台”成为占位符,“必需”属性确保⽤户必须select其中⼀个选项。
⾮常有⽤,当你不想⽤户字段名称或标签。
Bootstrap select有⼀个noneSelectedText选项。 您可以通过data-none-selected-text属性进⾏设置。 ⽂档 。
所有这些选项都是….即兴创作。 Bootstrap已经为此提供了⼀个解决scheme。 如果您想更改所有下拉元素的占位符,则可以更改其值
引导⽂件中的noneSelectedText。
要改变个⼈,你可以使⽤TITLE参数。
例:
Continent:
input标签placeholder属性
AfricaAsiaAmerica NorthAmerica SouthAntarcticaAustraliaEurope
对于.html页⾯
Please selectABC
为.jsp或任何其他的servlet页⾯。
Please selectABC
在bootstrap-select.js查title: null,并将其删除。在元素中添加title="YOUR TEXT" 。
好:)
例:
ABC

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。