diff --git a/tagmanager.js b/tagmanager.js
index 68c3cfd..51dfbea 100644
--- a/tagmanager.js
+++ b/tagmanager.js
@@ -38,7 +38,8 @@
tagCloseIcon: 'x',
tagClass: '',
validator: null,
- onlyTagList: false
+ onlyTagList: false,
+ readOnly: false
},
publicMethods = {
@@ -106,9 +107,14 @@
escaped = $("").text(tag).html();
html = '';
- html+= '' + escaped + '';
- html+= '';
- html+= opts.tagCloseIcon + ' ';
+ html += '' + escaped + '';
+
+ if (!opts.readOnly) {
+ html += '';
+ html += opts.tagCloseIcon + '';
+ }
+
+ html+= ' ';
$el = $(html);
if (opts.tagsContainer !== null) {
@@ -416,6 +422,10 @@
privateMethods.killEvent(e);
});
+ if (opts.readOnly) {
+ $self.attr('style', 'display: none');
+ }
+
if (opts.prefilled !== null) {
if (typeof (opts.prefilled) === "object") {
privateMethods.prefill.call($self, opts.prefilled);