1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > html下拉框占位 引导select下拉列表占位符

html下拉框占位 引导select下拉列表占位符

时间:2019-06-13 14:27:30

相关推荐

html下拉框占位 引导select下拉列表占位符

是的,只是“select禁用”的选项。

Please selectABC

链接到小提琴

您也可以查看答案

使用隐藏:

Display but don 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

尝试这将工作更好:)

Select...

当使用required + value=""用户不能使用hidden的选项将其隐藏,从选项列表中隐藏,当用户打开选项框

试试@title =“东西”。 它为我工作。

使用Bootstrap,这是你可以做的。 使用类“文本隐藏”,禁用选项将首先显示,但不在列表中。

TitleABC

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。