Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you've got jQuery UI included in your project, you should be able to call:</p> <pre><code>$( "#tags" ).tagit().sortable(); </code></pre> <hr> <p><strong>EDIT</strong></p> <p>Line 102</p> <p>Comment out <code>self._removeTag();</code> in tagit.js</p> <pre><code> this.options.select = function(event, ui) { //self._removeTag(); self._addTag(ui.item.value); return false; } </code></pre> <hr> <p><strong>EDIT</strong></p> <p>Example Revised:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/&gt; &lt;link href="http://webspirited.com/tagit/css/tagit-simple-blue.css" rel="stylesheet" type="text/css"/&gt; &lt;style&gt; body, #demo2 { height:150px; } #demo2 { background-color:green; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;ul id="demo2" name="demo2"&gt; &lt;li&gt;here&lt;/li&gt; &lt;li&gt;are&lt;/li&gt; &lt;li&gt;some&lt;/li&gt; &lt;li&gt;initial&lt;/li&gt; &lt;li&gt;tags&lt;/li&gt; &lt;/ul&gt; &lt;input id="btnGetItems" type="button" value="GetVals" /&gt; &lt;/body&gt; &lt;/html&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://webspirited.com/tagit/js/tagit.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; $(function(){ $('#demo2').tagit({tagSource: availableTags}).sortable(); $('#btnGetItems').click(function(){ getTags(); }); }); function getTags() { var string = "Tags\r\n"; string +="--------\r\n"; $('#demo2 li.tagit-choice').each(function(){ var $tmp = $(this).clone(); $tmp.find('.tagit-close').remove(); string += $tmp.html()+"\r\n"; }); alert(string); } &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload