Skip to content

Instantly share code, notes, and snippets.

@d34th4ck3r
Created June 8, 2012 15:15
Show Gist options
  • Save d34th4ck3r/2896107 to your computer and use it in GitHub Desktop.
Save d34th4ck3r/2896107 to your computer and use it in GitHub Desktop.
<script>
$(function() {
var availableTags = [
"Fruits",
"Vegetables",
"CSS","Python","C","Go Go Go!","Comic"
];
$('#demo1').tagit();
$('#demo1GetTags').click(function () {
showTags($('#demo1').tagit('tags'))
});
});
function showTags(tags) {
console.log(tags);
var string = "Tags (label : value)\r\n";
string += "--------\r\n";
for (var i in tags)
string += tags[i].label + " : " + tags[i].value + "\r\n";
alert(string);
}
</script>
<div id="tagging" align="center" padding="100px">
<br /> <br /> <br /> <br />
<ul id="demo1" name="nameOfSelect"></ul>
<div class="buttons">
<button id="demo1GetTags" value="Get Tags">Get Tags</button>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment