Permalink
Browse files

add a param for placeholder text on the automatically created input e…

…lement
  • Loading branch information...
1 parent 396745e commit a877af548684829a4adc1d449c88e755f4a0a2de Ben Oberkfell committed Nov 17, 2011
Showing with 9 additions and 0 deletions.
  1. +5 −0 README.markdown
  2. +4 −0 js/tag-it.js
View
@@ -147,6 +147,11 @@ Optionally set a *tabindex* attribute on the `input` that gets created for tag-i
Defaults to *null*
+### placeholderText (String)
+Optionally set a *placeholder* attribute on the `input` that gets created for tag-it user input.
+
+Defaults to *null*
+
## Events
View
@@ -34,6 +34,7 @@
tagSource : null,
removeConfirmation: false,
caseSensitive : true,
+ placeholderText : null,
// When enabled, quotes are not neccesary
// for inputting multi-word tags.
@@ -100,6 +101,9 @@
if (this.options.tabIndex) {
this._tagInput.attr('tabindex', this.options.tabIndex);
}
+ if (this.options.placeholderText) {
+ this._tagInput.attr('placeholder', this.options.placeholderText);
+ }
this.options.tagSource = this.options.tagSource || function(search, showChoices) {
var filter = search.term.toLowerCase();

0 comments on commit a877af5

Please sign in to comment.