[英]How To add a placeholder to jQuery Tokeninput?
How can I add a placeholder to a jQuery Tokeninput field? 如何将占位符添加到jQuery Tokeninput字段? A normal
placeholder
attribute won't work in here. 普通的
placeholder
属性在这里不起作用。
For a input like: 对于像这样的输入:
<input type="text" id="myInput" />
You can do: 你可以做:
$("#myInput").tokenInput("/scripts/myjson.js");
$("#token-input-myInput").attr("placeholder", "Type here");
When you use tokenInput, it changes your input's id to "token-input-XXX", where XXX is the previous id 使用tokenInput时,它将输入的ID更改为“ token-input-XXX”,其中XXX是先前的ID
I think the current version of tokenInput
supports this: 我认为当前版本的
tokenInput
支持此功能:
$(function() {
$("#elementID").tokenInput("http://www.foo.com/bar", {
placeholder: 'Place holder text...'
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.